cancel
Showing results for 
Search instead for 
Did you mean: 

Item Category determination based on Order Reason

Former Member
0 Kudos

Hi experts,

There is a requirement where for a particular sale order type ( ZSC in this case ), there are 6 types of order reasons available.

And depending upon the order reason chosen, the corresponding item category needs to be determined automatically. It is a 1:1 relationship. That is for each order reason, there is an item category. This is not defined anywhere yet.

Is there any way of configuring this through customization or programatically in any user-exit available?

The user is ok with creating a customization table for mapping the order reason to item category. In this case, which exit should I write the code to automatically assign the item category according to the order reason chosen by checking this table.

Please help.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Lakshmipathi
Active Contributor
0 Kudos

Since the Order Reason (AUGRU) is at header level (VBAK) and Item Category (PSTYV) at item level and the requirement is to check both these fields, you can try with any of the following exits:-

=> User exits in the program MV45AFZZ - USEREXIT_MOVE_FIELD_TO_VBAP

=> User exits in the program MV45AFZZ - USEREXIT_READ_DOCUMENT

Also I am not clear on this

That is for each order reason, there is an item category. This is not defined anywhere yet

Do you mean to say that you have not made assignment in VOV4 ?? If so, what assignment is made.

In fact, in the exit, the coding should be in such a way that system should ignore this table T184, and check for the combination you mentioned for which you need to have a zee table with the combination of

a) Sale Order Type

b) Order Reason

c) Default Item Category and

d) Manual Item Category

thanks

G. Lakshmipathi

Former Member
0 Kudos

Hi Lakshmipathi,

The assignment has been made in VOV4. That is for the Sale Document type ZSC, there are 6 item categories assigned. But the business also has 6 order reasons for this document type. When you choose an order reason, the corresponding item category needs to get automatically assigned. So I guess I need to create a zee table for this.

Your answer has been helpful though. I would research more on the exits and would let you know if I get the solution.

Thanks

Former Member
0 Kudos

The user exit in the program MV45AFZZ - USEREXIT_READ_DOCUMENT has worked very well for me.

I created a custom table to map the order reason to item category. So in VA01, when you select a particular order reason, this user exit gets triggered and selects the item category from the table and displays it on the screen.

Thanks a lot!

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

Yah you need a Z table or a TVARVC variable to be defined which will have an sisngment between order reason and item category. You can code the logic in userexit USEREXIT_SAVE_DOCUMENT_PREPARE in MV45AFZZ.

Thanks

Indranil