Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

userexit_save_document_prepare

Former Member
0 Likes
1,103

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

4 REPLIES 4
Read only

Tamas_Hoznek
Product and Topic Expert
Product and Topic Expert
0 Likes
906

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.

Read only

Former Member
0 Likes
906

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.

Read only

Tamas_Hoznek
Product and Topic Expert
Product and Topic Expert
0 Likes
906

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.

Read only

0 Likes
906

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!