Mandatory Malfunction End Date/Time fields for NOCO
One of the very common requirements in SAP-PM while configuring the Notification Type ‘M2’ is that the ‘User should not be able to get the NOCO status to the Notification, until the Malfunction End Date and Time fields (AUSBS & AUZTB) are not filled’. SAP standard, due to some reason did not provide this, but for all such requirements some or other tool has certainly been provided. The instrument to achieve the present task is User Exit IWOC0002.
Just put the following code in the include here namely ZXWOCU10.
IF I_VIQMEL-QMART = 'M2' . IF I_VRGNG = 'PMM4' AND ( I_VIQMEL-AUSBS IS INITIAL OR I_VIQMEL-AUZTB IS INITIAL ). MESSAGE 'Fill The Malfunction End Date & Time before Completing the Notification' TYPE 'I'. RAISE NO_STATUS_CHANGE. ENDIF. ENDIF.
Alternatively we can achieve this, also through User Exit QQMA0014. For this, put the following code in the include here namely ZXQQMU20.
IF I_VIQMEL-QMART = 'M2'. IF E_VIQMEL-PHASE = '4' AND ( I_VIQMEL-AUSBS IS INITIAL OR I_VIQMEL-AUZTB IS INITIAL ). MESSAGE 'Filling Malfunction End Date/Time is mandatory for completing Notification' TYPE 'I'. RAISE EXIT_FROM_SAVE. ENDIF. ENDIF.
When continued, the NOCO preventing pop-up (see below) appears and user will not be able to complete the Notification.
In both the codes, it is assumed that this requirement is for Notification type M2. So make changes in the first line of the codes accordingly as per the Notification type/s relevant to you.
Like another such common requirement by SAP-PM people which was discussed in this post, the present one is also found to be very frequently required. Hence this post. Hope members would find this too useful.
Thank you & Regards
Jogeswara Rao K