cancel
Showing results for 
Search instead for 
Did you mean: 

Status profile

Former Member
0 Kudos

Hello All,

Can you please let me know if we could disable editing of the sales order using status profile once the order is approved by approver for delivery/ billing.

Thanks and regards,

Mathew

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

You can conveniently do this in USEREXIT_READ_DOCUMENT in MV45AFZZ. This user exit is called after the Sales order number is entered in the initial screen of VA02 and before the order details screens are shown. So it is ideally suited for your purpose.

We have similar coding in our production system where we show error message to the user if he tries to open the sales order in VA02 and the sales order is already released/signed, captured by a status in our custom status profile

The coding may look like. You can make appropriate changes to suit your requirement.

if vbak-auart = 'ZOR' and sy-tcode = 'VA02'. 

concatenate 'VB' vbak-vbeln '000000' into zobjnr.

 select single stat into jest-stat
   from jest
   where objnr = zobjnr
     and stat = 'E0003'
     and inact = space.
 if sy-subrc = 0.
* Order status is E0003 - cannot change
   message id 'Z5' type 'E' number '134'.
 endif.
endif.

Shiva_Ram
Active Contributor
0 Kudos

You may need to use user exit USEREXIT_SAVE_DOCUMENT_PREPARE or USEREXIT_SAVE_DOCUMENT in program MV45AFZZ.

Regards,