cancel
Showing results for 
Search instead for 
Did you mean: 

Create Notification by Reference to Another Notification

Former Member
0 Kudos

Is there a way to define the data that gets copied when creating a new notification with reference to an existing notification?

Specifically, I do not want to copy the tasks from the existing notification.

Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

jogeswararao_kavala
Active Contributor
0 Kudos

Hello again Peter,

The following code in place of the previous code,

  • Removes the OSTS status from the Notification (when you Create a Notification with Reference Notification no. which has got OSTS or ATCO status)
  • Also clears the only Task line in Tasks tab (that was appearing previously),  upon Notification Save.
IF sy-tcode = 'IW21' AND i_viqmel-qmart = 'M2'.

   DATA: BEGIN OF i_qmsm OCCURS 0.
           INCLUDE STRUCTURE viqmsm.
   DATA:END OF i_qmsm.

   DATA: it_stat TYPE TABLE OF jstat,
           wa_stat TYPE jstat.

   SELECT * FROM viqmsm INTO TABLE i_qmsm WHERE qmnum = i_viqmel-qwrnum.

   LOOP AT i_qmsm.
     e_viqmsm-qmnum = ''.
     e_viqmsm-manum = ''.
     e_viqmsm-mngrp = ''.
     e_viqmsm-mncod = ''.
     e_viqmsm-matxt = ''.
   ENDLOOP.

   wa_stat-stat 'I0158'.
   wa_stat-inact = 'X'.
   APPEND wa_stat TO it_stat.
   CALL FUNCTION 'STATUS_CHANGE_INTERN'
     EXPORTING
       objnr  = i_viqmel-objnr
     TABLES
       status = it_stat.
   e_viqmsm-qsmnum = '1' .
   e_viqmsm-kzloesch = 'X' .

ENDIF.

So if you want to have Tasks in the newly created Notification, first Save the Notification and Add your tasks through IW22. The bottom line is you have to make use of this exit for your requirement. Take help of your ABAPer, who will be able to do this very easily.

Good luck

KJogeswaraRao

jogeswararao_kavala
Active Contributor
0 Kudos

Hello Peter,

The following code in include ZXQQMU37 of user-exit QQMA0027, clears the entries in Tasks tab, but system has to retain the last task line (with blank CodeGrp and code) for technical reasons (Notification OSTS status). This means, suppose your reference Notification has got 10 tasks, now in the new Notification you'd see only one line with blank CodeGrp and Code values  This arrangement must be useful to you.

IF sy-tcode = 'IW21' AND i_viqmel-qmart = 'M2'.

   DATA: BEGIN OF i_qmsm OCCURS 0.
           INCLUDE STRUCTURE viqmsm.
   DATA:END OF i_qmsm.
   SELECT * FROM viqmsm INTO TABLE i_qmsm WHERE qmnum = i_viqmel-qwrnum.

   LOOP AT i_qmsm.
     e_viqmsm-qmnum = ''.
     e_viqmsm-manum = ''.
     e_viqmsm-mngrp = ''.
     e_viqmsm-mncod = ''.
     e_viqmsm-matxt = ''.
   ENDLOOP.
   e_viqmsm-qsmnum = '1'.

ENDIF.

Please note the Notification type mentioned in the code above. (You may change this if yours is different).

Good luck

KJogeswaraRao