‎2009 Jun 30 7:04 AM
Hi all
In the user exit MV45AFZZ, I would like to stop the delete processing in some case and throwing a message to the user.
MV45AFZZ:
FORM userexit_delete_document.
if A > B.
Stop process and throw message.
endif.
ENDFORM. "USEREXIT_DELETE_DOCUMENT
Can someone tell me how to do so?
Thank you.
Olivier D.
‎2009 Jun 30 7:06 AM
Can you try this -
FORM userexit_delete_document.
if A > B.
" Stop process and throw message.
Message E000(YOUR MESSAGE CLASS) WITH TEXT-NNN. "
endif.
ENDFORM. "USEREXIT_DELETE_DOCUMENT
‎2009 Jun 30 7:09 AM
Use this:
Please find the exceptions in that user exit and assign the value of sy-subrc accordingly.
if A > B.
sy-subrc = n.
EXIT.
endif.OR
if A > B.
Message E000(ZMC) with 'your message'.
endif.Thanks and Regards
‎2009 Jun 30 7:12 AM
HI Joskin,
if A > B.
" Stop process and throw message.
message 'Error Occured' type 'E'.
endif.
Try this type logic.
Regards,
Vijay
‎2009 Jun 30 7:14 AM
HI ,
1) You raise error message at particular condition without terminationg your program , only terminate the Routine .
FORM userexit_delete_document.
if A > B.
message lv_message display like 'E'.
endif.
ENDFORM. "USEREXIT_DELETE_DOCUMENT
2) if u want to terminate the program , then code is...........
FORM userexit_delete_document.
if A > B.
raise message
stop. (keyword)
endif.
ENDFORM. "USEREXIT_DELETE_DOCUMENT
Thanks
Shambhu
‎2009 Jun 30 7:16 AM
Use CHECK or RETURN.
See F1 help for more details.
Regards
Karthik D
‎2009 Jun 30 7:16 AM
Hi,
USe the code mentioned below:
FORM userexit_delete_document.
if A > B.
Message E000(MESSAGE CLASS).
endif.
ENDFORM. "USEREXIT_DELETE_DOCUMENT
You can pass message text in SE91 under message classes available with you.
Or just double click on the E000, to create a new message.
Regds,
Anil