Hello Community :)
Is there a way to add positions to an existing purchase order? I've tried to record a skript with ME22 but there's no command like "go to last row" or "new position".
Our purchase department often has to edit existing orders and also to add several new lines / positions.
Hope I put my words so that you understand what I need :) Thank you all in advance, have a great day!
PS: We're using Studio 20.2.9 :)
Unless you have a very long PO you can use the filtering option and go to line 999.
The following document describes how to deal with header details for ME21N but it works the same for ME22N.
its about time to reply to your helpful hint to use ME22N with the filtering option. That helped a lot. Thank you very much!!But like I have forseen ... My skript struggels with the section opening or closing issue. I've found another thread, where Jan van Asseldonk gave some great tips. (https://community.precisely.com/communities/community-home/digestviewer/viewthread?GroupId=865&MID=45245&CommunityKey=4418e63a-9f6f-4468-b3f1-0186605ed001) so I think I'm gonna try and play with this. Will see if I'll be able to run more than one transaction succsessfully :D
I'm very close to tell our purchase department that they better create new PO's insteat of adding positions to existing orders....Well irony mode off: My script doesn't work. The first transaction runs well but the following ta's not. When I then go and debug them all, everything works perfectly. So it seems to be worth a thought, if I put on Debug-Mode and put a heavy item on my enter key for make the script runnng?! ;)
So great you're hanging in there and trying suggestions. :)
Can you please post your script and perhaps template (you can cleanse it of anything confidential)? Also please share where it's breaking, maybe a screen shot?
my script and the template are in German... I hope you'll still be able to read and see things. As for the "break points": I can't provide anything, because if I go on debug-mode everything works fine.
Thank you so much. Your help is really appreciated!
Its closing time now over here in Germany. Have yourself a great day. Best regards,Iris
One thing at the start is that you only want to swap to edit mode for the first transaction - after that SAP remembers, so this needs an IF First Transaction
I don't believe you need these in your loop, and in fact in the last section, you have two OK codes
So I would get rid of the first two sections and get rid of METOGGON3 and have the first thing in the loop be the filter.
Also in the detail lines, it will remember the tab you left off on, so I recommend you go back to the first tab in the loop at the bottom
for me that's this
TABIDT3 took me back to the first tab.
You may consider also disabling all cursor rows - they're not needed.
That's all I have time for right now. Hope this gets you started.
wow! Thank you very much for this indept analysis. Awesome <3 !!I did most of what you suggested. The "first transaktion" condition I already had in my scipt but I wasn't sure if WinShuttle needs a "then" order. But it appears to be not the case.
Next I did was more of a "trial and error" thing. E.g. changing some "go to tab" directions. I'll enclose the new script because ..... tadaaa... IT WORKS NOW :) I'm very happy and wanna thank all who helped directly or in case of Jan van Asseldonk indirectly. Thank you so much!
Have a great day, best regards,Iris
Super happy to hear that it's working, @Iris Müller! It's one of the tougher tcodes to automate, so you are not alone in this. That's why I prefer a BAPI, but that has it's own learning curve.
Thanks for letting us know and for sharing your script with others!
Rick pointing you to the step by step guide is great.
You could also consider using a BAPI: BAPI_PO_CHANGE in the Direct part of Studio. It takes the interface out of the picture, which for this "Enjoy" tcode is a good thing! :)