Ansicht
Dokumentation

QM_SCRAP_FOR_MATLST - Provide Scrapping Data for EWM-Managed Materials

QM_SCRAP_FOR_MATLST - Provide Scrapping Data for EWM-Managed Materials

CL_GUI_FRONTEND_SERVICES - Frontend Services   ABAP Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

With this Business Add-In, you can scrap defective materials and charge the supplier with the costs of the scrapping.

With the BAdI you can determine all additional costs that occur with the scrapped material and that cannot be considered in a standard process. You can use the example BAdI implementation as a reference.

In the standard system, the BAdI decreases the quantity of the purchase order after the goods issue of the outbound delivery. The processing and charging of scrapping costs to the supplier is not implemented in the BAdI. You need to define the charging of the scrapping costs to the supplier according to your business needs in your BAdI implementation.

The BAdI gets all notification items as an inbound parameter and returns a material list in the form of an outbound delivery items list. Once the BAdI was executed, the standard system uses the returned delivery items list to create the outbound delivery. When saving the notification, the outbound delivery is posted to the database. No goods are actually returned but the respective purchase order items are reduced by the scrapped quantity and the costs for scrapped materials can be charged to the supplier.

All other necessary process steps such as the goods issue and the charge of the supplier with the costs must be performed manually with respective standard transactions.

With the BAdI you determine the affected materials to collect the respective costs and to trigger a process to charge these costs to the supplier by customer-specific functions. The BAdI provides the following data:

  • A list of materials with reference to their original purchase order(s) as the basis for the creation of an outbound delivery.
  • A delivery type for the creation of the outbound delivery.
Recommendation:
In order to differentiate the process from a real return delivery, you should create a separate delivery type that automates the goods issue process since no transport documents or packaging information are needed.
  • A material movement type of outbound delivery. This must be movement type 122 (Return Delivery) or a respective customer-specific copy of it.

Using the example implementation of the BAdI (see below):

The example implementation considers one notification item with one material list that can be assigned to one purchase order.

The following settings are used in the coding of the example implementation:

  • Delivery type ZRLL: The example BADI implementation refers to a delivery type ZRLL. This delivery type is not defined in the standard system. You have to create a delivery type with this name in Customizing which will be automatically used in the example implementation. If you use a different delivery type it can be changed in coding by using BADI method SET_DELIVERY_TYPE.
  • Movement type 122 (Return Delivery): The BADI example implementation uses automatically movement type 122. The type can be changed in coding of example implementation by using BADI method SET_MOVEMENT_TYPE. A copy of movement type 122 should be used.

The following checks are performed:

  • The materials were posted to blocked stock in the EWM warehouse.
  • The materials do not have a reference to documents in delivery processing for example to an inbound delivery.
  • All materials of the material list are contained in one purchase order.
  • The supplier in the quality notification header matches the supplier in the assigned purchase order.
  • There is no check whether the user changes the supplier after having saved the quality notification and the outbound delivery for scrap.
  • A supplier is entered if partner Supplier is mandatory in the notification header.
  • There is no check if partner Supplier is not mandatory.
  • Goods receipt documents exist for the materials. But you cannot assign the scrapping quantity to a specific material document and it is not possible to split the scrapping quantity across several goods receipt documents.
  • The implementation checks the goods receipt and goods issue documents of the purchase order items for the materials. The available goods quantity has to be higher or equal to the scrapped quantity. If the available quantity is lower than the scrapped quantity, the activity is terminated.

Define a customer-specific implementation:

If you want to create an outbound delivery across several notification items with different material lists and different purchase orders assigned you have to create a customer-specific implementation. You also have to implement the necessary checks in the implementation.

Define an action box activity:

You start the process of charging scrap to a supplier as an action box activity in a quality notification:

  • The BAdI is called with the function module QM_EWM_ACT_SCRAP_SUPLR that you can use to customize the action box activity.
  • You assign a task code to which the standard follow-up action SAP_CSTS was assigned.

Process after saving the notification:

  • An outbound delivery is created based on the return delivery items and dependent on the defined delivery type assigned in the BAdI.
  • The follow-up action SAP_CSTS adds the created outbound delivery and the referenced purchase order to the document flow of the notification header.
  • The quantity of the referenced purchase order is reduced by the amount of the scrapped materials.
  • Depending on Customizing, further steps like creating a warehouse task can be executed automatically.
  • The goods issue is posted as an outbound delivery. The stock of the materials assigned to the notification is identified and removed from the EWM warehouse.
  • You have created an active BAdI implementation.
  • You have defined a delivery type that is customized for the process of creating an outbound delivery for charging scrap to the supplier. You add it to your BAdI implementation with BAdI method SET_DELIVERY_CATEGORY. If you use the example implementation, you could define delivery type ZRLL which is already used in the coding of the example implementation.
  • You have defined an action box activity for charging scrap to the supplier.
In the action box activity you have assigned the function module QM_EWM_ACT_SCRAP_SUPLR that will call your BAdI implementation.
  • You have assigned the standard follow-up action SAP_CSTS to a task code that is valid for the quality notification type and assigned the code to the action box activity.
The standard follow-up action SAP_CSTS has already been assigned as a filter to the example implementation QM_FOA_NTF_BCKW_EWM_POST of the BAdI FOA_BACKWARD_COMPLIANCE.
It is also assigned as a filter to the example implementation QM_FOA_SCRAP_SUPPLIER_EWM of the BAdI FOA_EXECUTION_FOR_TASK. The BAdI will save the created outbound delivery and create the document flow.
  • If you call the action box activity in the quality notification, a task has been created and the follow-up action is executed when the notification is saved.
  • IS_NOTIFICATION
Import parameter: Quality notification header
  • IT_QNOTIF_ITEM
Import parameter: List of notification items
Only notification items that are created from a warehouse defect with EWM-managed materials are taken into consideration. The caller of the BAdI checks the internal DFECTUUID of these notification items.
  • IT_QNOTIF_ITEM_AFFCTD_OBJECTS
Import parameter: Table of materials affected by a defect
  • CT_OUTBOUND_DLVRY_ITEMS
Changing parameter: Table with data for outbound delivery item

This example implementation supports the scrapping of a material list of one chosen notification item. If no notification item was selected in the notification transaction before action box activity was executed, a dialog box appears to select a single item with a material list. In the next dialog box, you have to enter a purchase order and a movement reason.

Both dialog boxes are part of the example implementation. However, within this BAdI example implementation, no scrapping costs are taken into consideration. Only after goods issue of the outbound delivery is the purchase order automatically updated by the decreased quantity.

Before activation of this example implementation, the following code adjustments must be made:

  • Copy the template class to your customer namespace.
  • In the coding, assign the delivery type that is to be used for the outbound delivery. You can define a delivery type ZRLL that is already assigned in the example implementation or you can define a customer- specific delivery type and assign your delivery type to the BAdI implementation. Look at the respective comments in the coding to identify the correct place.
  • If a customer-specific material movement type – a copy of the standard type 122 – is to be used, this movement type must be included in the coding as well. Look at the respective comments in the coding to identify the correct place.
  • After making the code adjustments, activate the coding.
  • Then activate the BAdI implementation.

Quality Management documentation on SAP Help Portal under Quality Improvement -> Quality Notifications -> Creating and Processing Quality Notifications -> Item -> Processing Items with Preceding Defects -> Charge Scrap to Supplier.






CPI1466 during Backup   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.

Length: 11182 Date: 20240523 Time: 191248     sap01-206 ( 175 ms )