Application Development 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: 

How to block deleteion of sales order items

Former Member
0 Kudos

We need to be able to block users from deleting sales order items. The objects V_VBAK_VKO and V_VBAK_AAT can be used at the 'order header' level but these do not prevent a user deleting an individual item in an order. Does anyone know of a way of achieving this through authorisations?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

We had a similar requirement where the line items can only be rejected and not deleted and we created a Z auth object for it called ZSD_SPART that has activity field for delete ( 06 )

If we do not give them this activity even though they see the delete icon in VA02 they do not have access to delete it.

3 REPLIES 3

Former Member
0 Kudos

We had a similar requirement where the line items can only be rejected and not deleted and we created a Z auth object for it called ZSD_SPART that has activity field for delete ( 06 )

If we do not give them this activity even though they see the delete icon in VA02 they do not have access to delete it.

Former Member
0 Kudos

The authorization to delete the items is controlled by the actvt 02 for the objects mentioned in your post. Unortunately you would not want to restrict that as it would then block the entire change authorization for the sales order.

You may try to create an transaction variant using SHD0 and try hiding the delete button. I am not sure how effectively you would be able to achieve it.

Regards,

Subbu

0 Kudos

Thanks for your responses. We have decided to use USEREXIT_CHECK_XVBAP_FOR_DELET in MV45AFZB with some code based on the AUTHORITY-CHECK syntax below:

AUTHORITY-CHECK OBJECT 'S_CARRID'

ID 'CARRID' FIELD pa_carr

ID 'ACTVT' FIELD '03'.

IF sy-subrc = 4.

MESSAGE e045(sabapdocu) WITH pa_carr.

ELSEIF sy-subrc <> 0.

MESSAGE e184(sabapdocu) WITH text-010.

ENDIF.

In our case we will reference object V_VBAK_AAT.