‎2011 Nov 18 7:33 PM
Hi,
I am using exit userexit_save_document_prepare to stop change in item line under conditions and it work fine in change mode. But if I try to delete the complete order when my message is reached in the exit I got a dump. Can I use another exit or BADI.
Regards,
Daniel Cantin
‎2011 Nov 18 7:52 PM
If you want to delete the order anyway, then there is no need for the logic that stops changing the item.
Just query the value of T180-TRTYP and if it is "V" then you are in change mode. Then make sure that the OK code selected is for deletion (FCODE = 'LOES') and if yes, then don't execute the steps causing the problem.
‎2011 Nov 18 10:48 PM
I understand but I need to cancel the delete order action when I found something in the reference table. I need a way to cancel via message the delete of the sale order.
Regards.
‎2011 Nov 18 11:40 PM
This thread may be of some help:
This will work perfectly in dialog transactions.
You'll have to experiment with coding for the case of BAPI calls that are mentioned as a possible problem. Perhaps just clearing the FCODE and setting the next screen (without leaving the screen) might work if the LEAVE SCREEN is the issue for the BAPI call.
‎2011 Nov 19 12:19 AM
Are you ensuring that your changes are confirming to the guide line as per the note below:
[Note 178328 - Problems due to incorrect user exits in SD|https://service.sap.com/sap/support/notes/178328]
It may take a while to read, but worth every penny of the time you spend on it!