cancel
Showing results for 
Search instead for 
Did you mean: 

Restrict the user not to save the Sales Order

Former Member
0 Kudos

Hi Experts,

There is requirement from my client where we have to restrict the user from saving the sales order via t-code va01. VA01 authorization is required only to user to check the computation of pricing conditions once new price is uploaded.

Is there any way to restrict this via authorization object? Please help.

Regards,

Sivanandan

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You want it on user base but if you make it non modifiable it will be in display mode for all users. But if you want to try this you can make it non modifiable in following path

Sales and distribution > Master Data > Customer Master > customer hierarchy > partner determination for sales document header.

The best approach  You can use the user exit MV45AFZZ and in the code

USEREXIT_READ_DOCUMENT (for display)

USEREXIT_SAVE_DOCUMENT_PREPARE (for create/change).

Thanks,

Rajesh


Former Member
0 Kudos

Hi Rajesh,

The requirement is that system should allow the user to enter required information in the sale order  and to check the condition record but it should not allow to save the sales order.

Regards,

Sivanandan

former_member223981
Active Contributor
0 Kudos

There is no specific authorisation object when you press the save button. It is relatively easy to check ths. Press /h to start the debugger to just before you click on the save button and set a breakpoint at statement authority-check. Then pres F8. The system will stop at any relevant authorisation checks. It will not stop at any relevant authorisation checks that will prevent the save.

Therefore, you need to look at using custom code to achieve your desired functionality. As already stated by a previous poster, you could use USEREXIT_SAVE_DOCUMENT_PREPARE. Another alternative is badi BADI_SD_SALES, method IF_EX_BADI_SD_SALES~SAVE_DOCUMENT_PREPARE. Within either ot these coding areas, you will need to maintain custom code that fulfils your requirement. IE You need to maintain code that will return da_subrc <> 0. If these routines return da_subrc <> 0, the sales order shall not be saved.  The code maintained in the enhancement coding may use a particular authorisation object; a full list can be seen i transaction SU21 and perhaps yuo could select a suitable one from this list. It also may be possible to avoid the need to use authoirsation objects; for example if this is just for one specific user, you could maintain code like IF SY-TCODE = 'VA01' AND SY-UNAME ='USER', SUBRC = 4. This would prevent the sales order being saved by the user. You could also incorporate a custom error/abort message explaining they are not authorisd to save the order.

Hope this helps.

former_member209761
Active Contributor
0 Kudos

Dear Sivanandan Ganesan,

Is this requirement valid for all users?

If so, then make a less used field like storage location in sales order and mandatory and include this in incompletion log.

Now, since there is no option for triggering the storage location in sales order without using an exit, system will not save the order due to the incompletion log.

Check and revert back.

Thanks & Regards,

Hegal K Charles