Skip to Content
0

User Exit MV45AFZZ SAVE_DOCUMENT_PREPARE change PSTYV

Aug 31, 2017 at 02:40 PM

366

avatar image
Former Member

Hello, I have to change the item category in VA01/VA02 depending on the positions account assignment. I did that in user Exit MV45AFFZZ SAVE_DOCUMENT_PREPARE and the item category gets updated to TAS when I save the document but the schedule lines do not change and no purchase Requisition is created. What can I do to have an automatic creation of the purchase Requisition, the same way as when I Change the item category manually to TAS before saving?

Thank you and best regards!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Jelena Perfiljeva
Aug 31, 2017 at 09:19 PM
0

This is a rather bizarre requirement but, naturally, SAVE_DOCUMENT is waaaay too late to change item category. Search for VBAP user exit.

There is a lot of information on SD user exits in Google, as well as in documentation.

Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thank you for your answer. Normally we are changing the item category in user exit MOVE_FIELD_TO_VBAP but this user exit is not triggered after changing the account assignment. Any suggestions for a fitting user exit?

0

You might want to reply to G.Lakshmipathi's question- what exactly is the business process here? Changing item category based on the account assignment doesn't seem logical to me either.

0
Former Member

I tried to describe the business process there now. I know this is an odd requirement and there are better solutions but business wishes it as described. Could you please also have a look? Thank you very much!

0
Phil Cooley Sep 06, 2017 at 01:47 AM
0

Hi

There is a specific user exit for this called USEREXIT_SOURCE_DETERMINATION which is a form inside program MV45AFZB. This user exit is for setting the plant or item category from a Z Field or changing the contents. I am guessing you are not performing configuration because you only want this in some instances. If this is the case I would recommend you create a separate process altogether - new documents types etc and then just ask users to raise these type so you are not fiddling with stuff in user exits.

See how you go.

cheers

Phil Cooley

Share
10 |10000 characters needed characters left characters exceeded
G Lakshmipathi
Sep 01, 2017 at 07:37 AM
0

It would be better if you explain the business process

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

I will try. The requirement is coming from our Service.

First of all we have a difference in procurement between normal Spare Parts and Technical Upgrades for our machines at the customer. Ordering normal Spare Parts should always trigger MRP

(Z item category -> Schedule Line Category YP), Technical Upgrades should trigger an intercompany purchase requisition (Standard item category TAS -> Schedule Line Category CS).

In case we have a Technical Upgrade at one of our machines, we are using a special Z maintenance activity type in our Service Order which we are not using for normal Spare Parts. After creating the Service Order, business will create the Sales Order using the Service Order as account assignment on position level and wants to use the same sales order type they are using for normal Spare Parts. Standard item category is the Z-item category. To determine whether the item category in the sales order automatically needs to be changed to TAS or not trigger should be the account assignment of the position on a service order with this Z maintenance activity type.

Determining the item category based on material data is not possible since the material could also be used as normal Spare Part without being a technical upgrade. A new sales order type is also not an Option for the business since they want to make it as easy as possible for the users, for them there should be no difference between creating a sales order for Spare parts or Technical Upgrades. So only possibility is changing the item category based on the account assignment on the Service Order with Z maintenance activity type and this is also the solution business wished, even if there are better solutions with only slight changes of the business process. Now I'm in need of the correct user exist to place my coding. Best place would be an user Exit which is called after filling out the account assignment.

I hope you are able to help me out. Thank you very much!

0

Not sure I understand the whole setup but why "Technical Upgrade" has to be the same material number as "Spare Part"? That's where you seem to be shooting yourself in the foot. Even if these are related (i.e. "technical upgrade" does not exist by itself and can only be used with "spare part") then it still could be some sort of BOM or "package" where "technical upgrade" would be an add-on material to the spare part.

I agree with Phil that fiddling with the user exits here just does not seem like the best idea. And, as you've seen, the account assignment is not even part of VBAP so it does not trigger any relevant user exits. That's just another clear indication of why this is not a good option.

Not re-using the same material number will also help you with reporting IMHO and allow to automate document flow, if needed. In general, it's not difficult to write a program to generate a sales order based on the service order and avoid manual entry altogether. But this kind of complication (same material that goes completely different ways) makes everything more complex than it should be.

0
G Lakshmipathi
Sep 06, 2017 at 12:05 PM
0

Try with Function Module EXIT_SAPFV45E_001

Share
10 |10000 characters needed characters left characters exceeded