Skip to Content
avatar image
Former Member

User Exit MV45AFZZ SAVE_DOCUMENT_PREPARE change PSTYV

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!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Aug 31, 2017 at 09:19 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

    • 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!

  • Sep 06, 2017 at 01:47 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 01, 2017 at 07:37 AM

    It would be better if you explain the business process

    Add comment
    10|10000 characters needed characters exceeded

    • 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.

  • Sep 06, 2017 at 12:05 PM

    Try with Function Module EXIT_SAPFV45E_001

    Add comment
    10|10000 characters needed characters exceeded