cancel
Showing results for 
Search instead for 
Did you mean: 

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

former_member201541
Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

jogeswararao_kavala
Active Contributor

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

former_member201541
Participant

Thank you K Jogeswara Rao. The sample code is working for me.

Thank you once again

Answers (2)

Answers (2)

sebastian_lenartowicz
Active Contributor

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.

peter_atkin
Active Contributor