Well, in my current development tasks, I’m really pushing to reuse code in more and more of my applications. You know, that whole object oriented approach that should be standard for everything =) Well, one of the tricks I discovered lately is that if you can do a call transaction and skip first screen from within an application.
It’s great, SAP even provides a statement that allows you to do this. However, what I found is that there are limitations, as well as some “unforeseen” behaviors that result from using this statement. So here’s what you need to know.
If you are using a custom transaction, in the “first” screen, you need to make sure that the “Next Screen” on the attributes tab points to another screen number. Sounds easy enough, but what I discovered is that using this next screen has some weird impacts on running the transaction normally. For example, my custom transaction has all of the controls in the PAI/PBO code to tell it what to do next. When I manually pointed to another screen, suddenly my PAI behavior changed. When I hit enter it moved to the next screen. My original coding required pressing execute. While this isn’t the end of world, when I was green arrowed out of the results screen it now left my transaction, instead of returning to the first screen. This behavior was certainly unacceptable for the flow I wanted.
OK… how do you get past this. I took a very easy approach, and let me know out there if there is a better way to handle it. I created a new screen (a copy of my first screen, and this time I changed the “Next Screen”) I didn’t change anything else. Then I created a new transaction code that started from the new screen. So now I have 2 different transactions. 1 for on-line users, 1 to be called from a program. This worked perfect for me, but of course it is extra data, that to me seems unneeded.
Thanks for reading, and I hope this can help you…
As always, thanks for reading and don't forget to check out our SAP Service Management Products at my other company JaveLLin Solutions,
Mike