Changing Function Module
SM02_SET_LAST_USREMSG_ID
...
1. Start transaction SE37.
2. Enter SM02_SET_LAST_USREMSG_IDin the Function module field and choose Change.
3. Enter the following lines at the end of the program code, before the ENDFUNCTION statement:
*
---------------------------------------------
* Write last message read in the table
* ---------------------------------------------
SELECT SINGLE FOR UPDATE * FROM TEMSGU WHERE BNAME = SY-UNAME.
TEMSGU-BNAME = SY-UNAME.
TEMSGU-BDATE = SY-DATUM.
TEMSGU-BID = LAST_USR_EMSG.
MODIFY TEMSGU.
ENDFUNCTION
4. Choose Save and then Activate.