Application Development 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: 

Automatically execute a tcode after a save event in another tcode

Former Member
0 Kudos
337

Hi there,

I have a requirement related to Article Maintenance (transactions MM41 / MM42). The business wants SAP to automatically execute transaction VKP5 upon a successful save of an article in MM41 or MM42. When VKP5 is run it also must bring in the article number to the selection screen.

I can't seem to find a BADI or exit that will bring in the proper information to do this. I did find one that executed after a save (BADI_GTIN_VARIANT) but it doesn't bring in the article information for some reason. There was another BADI that did bring in the information and executed after an article save, but it executed multiple times upon a save. This also is also not going to work as VKP5 would be executed over and over (BADI_ARTICLE_REF_RT). If anybody knows of another exit or badi that might do this please let me know.

Also, is workflow a better way to automate this process? If so, does anybody know which object to use to do this? 'BUS1001' seems to be the one, but it doesn't have an event for Article Create or Change?

Any input is much appreciated!

Cheers,

Lee

1 REPLY 1

Former Member
0 Kudos
79

After some more digging, I see that MM41 and MM42 are basically both shortcuts to function module 'MATERIAL_MAINTAIN_DIAL_RETAIL'. I can create a program that will execute this function, and then upon successful saving of an article I can call transaction VKP5.

As 'MATERIAL_MAINTAIN_DIAL_RETAIL' has an update flag returned this is now a simple process.

Lee