Damage Code & Cause Code Mandatory before Technical Completion(TECO)
Damage Code and Cause Code Mandatory in Notification before doing Technical Completion (TECO)
Often there is a requirement to populate Damage Code and Cause Code to meet Reporting Requirements. In standard SAP, there is no such functionality to hard stop Technical Completion of order if the Notification Damage Codes and Cause Codes were not maintained.
To achieve this, use Exit IWO10004. This Exit can be used for making damage and cause code mandatory in notification while TECO ’ing order.
Reason to implement: – Damage and Cause codes are useful in order to identify the root cause of the breakdown. These codes are inputs to the sap standard report MCI5 (or) IW69. So in order to identify these we need to maintain them mandatory while doing TECO. Users usually by pass these fields in Notifications not knowing the importance of them.
Risks Involved while implementing: – Firstly we tried through configuration settings in OIAL to set these fields mandatory in notification level through screen elements. But users identified that they can’t be able to figure out the actual damage and causes unless they complete the order. So, approached to the exit while Technical Completion of order.
Create a project using transaction CMOD.
Give a short text for the project, save and select Enhancement Assignment.
Here assign our identified Exit IWO10004, save and select Components.
Double click on the Function exit EXIT_SAPCOIH_004.
Double click on INCLUDE ZXWO1U03.
Paste the following code in Include
Exit Used: – IWO10004 (Maintenance order: Customer check for order completion)
Function Module: – EXIT_SAPLCOIH_004
Project: – ZI_IW32T
data : v_fecod type viqmfe-fecod, "VIQMFE (PM Notification - Item)" v_urcod type viqmur-urcod. "VIQMUR (PM Notification - Item Cause)" check caufvd_imp-auart eq 'PM01'. "Order Type PM01" if sy-subrc = 0. select single fecod from viqmfe into v_fecod "(FECOD = Damage Code)" where qmnum = caufvd_imp-qmnum. select single urcod from viqmur into v_urcod "(URCOD = Cause Code)" where qmnum = caufvd_imp-qmnum. if v_fecod is initial and v_urcod is initial. message id 'IM' type 'E' number 752 with 'Kindly fill up the damage code and Cause code..!'. exit. elseif v_fecod is initial and v_urcod is not initial. message id 'IM' type 'E' number 752 with 'Kindly fill up the damage code..!'. exit. elseif v_fecod is not initial and v_urcod is initial. message id 'IM' type 'E' number 752 with 'Kindly fill up the Cause code..!'. exit. endif. endif.
Save, check and activate.
Take help of your Abaper to implement this logic.
Above logic does the following to the work order while doing Technical completion(TECO)
If cause code is missing under notification-items
If Damage code is missing under notification-items
If Cause Code and Damage code were empty under notification-items, systems throws following error
Hope this blog helps to meet lot of business requirements…!!!
Feel free to comment and advice any improvements and suggestions.