Skip to Content
0

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

Mar 29, 2017 at 01:03 PM

125

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
K Jogeswara Rao Mar 31, 2017 at 10:22 AM
1

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

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

Thank you once again

1
Sebastian Lenartowicz Mar 31, 2017 at 08:18 AM
1

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.

Share
10 |10000 characters needed characters left characters exceeded
Peter Atkin Mar 29, 2017 at 02:23 PM
0
Share
10 |10000 characters needed characters left characters exceeded