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

Hardcode Reason code in sales order

Former Member
0 Likes
531

Hi experts,

Whenever we change a sales order, the system pops up a screen asking for the Reason Code.

I have written a code in the exit form "userexit_read_document" in MV45AFZZ for the sales order which hardcodes the reason code so that the popup does not appear e.g. I hardcode it to "ABC".

The problem is if the Reason Code in the sales order is already "ABC", then the popup for Reason Code still appears. Is there any way to suppress the popup in this case also?

Regards,

Dawood

3 REPLIES 3
Read only

former_member213851
Active Contributor
0 Likes
498

Hi Dawood,

You nedd to add your logic populate reason ABC inside Subroutine userexit_move_field_to_vbap in MV45AFZZ.

Read only

0 Likes
498

Reason code is at header level...why do we want to write code in userexit_move_field_to_vbap.

I already tried writing the code in userexit_move_field_to_vbak but it doesn't work.

Read only

0 Likes
498

Hi Dawood,

I thoght you were talking about Reason for rejection. 

But as you have written your logic inside userexit_move_field_to_vbak , have you put braek-point and check sy-subrc contents to check if hardcoded value 'ABC' is getting popualated inside AUGRU (Order reason) in the structure which is used at run- time.