Skip to Content

Notification not getting closed automatically when I set "Do not Execute" for Maintenance Order ?

Hi All,

How to close the notification automatically when we set the "Do not execute" for a maintenance order through IW22 and then go to WO i.e IW32. Path "ORDER->Functions->Complete->Do not execute", the maintenance order and its associated notification is getting closed but the same thing when we execute through tcode IW22 the notification linked to this is not getting closed automatically. Is it a standard functionality? If it is a standard then is there any Exits/BADI's available to achieve this requirement?

Thank you

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Mar 31, 2017 at 10:22 AM

    Ajinkya

    Here is solution for your issue.

    Put the following code in the include ZXWOCU07 of theexit suggested above (user-exit IWO10009 ).

    DATA: i_stat LIKE jstat OCCURS 0 WITH HEADER LINE.
    DATA: syst TYPE bapi2080_notsti.
    
    CALL FUNCTION 'STATUS_READ'
      EXPORTING
        objnr       = caufvd_imp-objnr
        only_active = 'X'
      TABLES
        status      = i_stat.
    
    LOOP AT i_stat.
      IF i_stat-stat = 'I0015'.
    
        CALL FUNCTION 'BAPI_ALM_NOTIF_CLOSE'
          EXPORTING
            number   = caufvd_imp-qmnum
            syststat = syst.
    
      ENDIF.
    ENDLOOP.

    I tested the code, working well. You may test it and deploy.

    Important:

    This might not work if your Notification is not ready for NOCO. Means it is having some checks incorporated through other exits (like mandatory fields etc). and they are not fulfilled.

    Good luck

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 31, 2017 at 08:18 AM

    Greetings Ajinkya,

    It is by standard that the Notification is not completed. The rationale behind that is that if the work had not been completed (setting system status NCMP), then in the process it might be required that the work requestor should review and close the Notification, so they are aware about the work having been cancelled.

    However, in some cases you might prefer to automatically close the Notification when the Order is being folded. To that end, you might use the FM EXIT_SAPLCOIH_009 (include ZXWOCU07).

    Please see the useful link from Peter Atkin above.

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 29, 2017 at 02:23 PM
    Add comment
    10|10000 characters needed characters exceeded