‎2011 Jul 31 2:31 PM
Dear experts,
I'm studying about the non restartable update function modules. Curiously, I created a simple non restartable update function module as follows:
FUNCTION Z_UPDATE_MODULE.
*"----------------------------------------------------------------------
*"*"Update Function Module:
*"
*"*"Local Interface:
*" IMPORTING
*" VALUE(IMP_ZSCARR) TYPE ZSCARR
*"----------------------------------------------------------------------
INSERT zscarr FROM imp_zscarr.
IF sy-subrc > 0.
MESSAGE 'Problem at Z_UPDATE_MODULE' TYPE 'A'.
ENDIF.
ENDFUNCTION.
I ran the module above by using imp_zscarr parameter with key fields which will make the INSERT operation fail due to the existing primary key in the destination table. As expected, I receive a message that the operation was not successful. Later, I deleted the row in the destination table whose key fields equal to the key fields in the imp_zscarr parameter I previously used. Then, I opened the transaction SM13 to see the update request table. There, as expected, I saw the previous update request which was marked as fail. Then, I selected the entry and then clicked the Repeat Update button. Unexpectedly, since this was a 'non restartable update module', the repeated update was successful and a new row was entered to the destination table.
Was there something wrong with my test method or this was all a normal behavior after all?
Thanks in advance.
Regards,
Haris
‎2011 Jul 31 5:48 PM
Hi Haris,
I must admit I was surprised too (because I reproduced the same issue as yours, but I know standard no-restart function modules cannot be restarted), so I debugged SM13, and found you have to set at least one SAP lock to transmit to the update task, in that case you cannot restart the LUW.
BR
Sandra
‎2011 Jul 31 5:48 PM
Hi Haris,
I must admit I was surprised too (because I reproduced the same issue as yours, but I know standard no-restart function modules cannot be restarted), so I debugged SM13, and found you have to set at least one SAP lock to transmit to the update task, in that case you cannot restart the LUW.
BR
Sandra