cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_ALM_NOTIF_DATA_MODIFY returns No changes made

eachtime
Explorer
0 Kudos

Hello experts.

I have the following issue.

I'm calling BAPI BAPI_ALM_NOTIF_DATA_MODIFY to modify notification items with the following code:


      CALL FUNCTION 'BAPI_ALM_NOTIF_GET_DETAIL'
        EXPORTING
          number             = wa_header_e-notif_no
        IMPORTING
          notifheader_export = wa_notif_header
*         NOTIFHDTEXT        =
*         MAINTACTYTYPE      =
        TABLES
*         NOTLONGTXT         =
          notitem            = it_notif_item
*         NOTIFCAUS          =
*         NOTIFACTV          =
*         NOTIFTASK          =
*         NOTIFPARTNR        =
          return             = return
*         EXTENSIONOUT       =
        .

      MOVE it_notif_item[] TO it_notif_item_tmp[].
      REFRESH it_notif_item.
      LOOP AT it_notif_item_tmp INTO wa_notif_item.
        IF wa_notif_item-dl_code = 'NEC'.
          wa_notif_item-descript = iv_workorder-jobno.
        ENDIF.
        IF wa_notif_item-dl_code = 'MPRN'.
          wa_notif_item-descript = iv_workorder-mprn.
        ENDIF.
        IF wa_notif_item-dl_code = 'IGT'.
          wa_notif_item-descript = iv_workorder-igt_id.
        ENDIF.



        CLEAR wa_notif_item_x-item_key.
*        CLEAR wa_notif_item-item_key.
        wa_notif_item_x-item_key = wa_notif_item-item_key.
        wa_notif_item_x-descript = 'X'.
*        wa_notif_item_x-dl_code = 'X'.
        APPEND wa_notif_item TO it_notif_item.
        APPEND wa_notif_item_x TO it_notif_item_x.
      ENDLOOP.



      CALL FUNCTION 'BAPI_ALM_NOTIF_DATA_MODIFY'
        EXPORTING
          number      = wa_header_e-notif_no
        TABLES
          notifitem   = it_notif_item
          notifitem_x = it_notif_item_x
          =
          return      = return
        .

      CALL FUNCTION 'BAPI_ALM_NOTIF_SAVE'
        EXPORTING
          number = wa_header_e-notif_no
        .


      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' .

      CALL FUNCTION 'DEQUEUE_ALL'
        EXPORTING
          _synchron = 'X'.
      COMMIT WORK AND WAIT.

The return table returns from modify BAPI: "No changes made". I've checked the standard code and it fails in:

FORM CHANGE_NOTIFITEM SAPLIWON of
FUNCTION IWON_NOTIFICATION_DATA_MODIFY SAPLIWON
on line 258:

LOOP AT P_NOTIFITEM_X.

    clear p_more.                                      "note 526354

    LOOP AT P_NOTIFITEM WHERE ITEM_KEY = P_NOTIFITEM_X-ITEM_KEY.

The line is comparing key '0001' with '0001' which is the same value but the loop fails and jumps off and I get this no changes made result.

Can you please advise?

Thanks,

Accepted Solutions (0)

Answers (1)

Answers (1)

eachtime
Explorer
0 Kudos

I've found what the issue was. The import notification items table is from a different type that of the get detail BAPI.


Moving the result to a table of the correct type solved the issue.