Has this happened to someone you know: in their eagerness to start development for a repair or change, they forgot to confirm if the development version being worked upon was in sync with production? Thus promoting unintended code to production. The consequences of that are never pretty!
Let’s consider a simplified scenario (derived from real life 😛 ): Person A makes changes to a program, activates it and deletes his transport. Subsequently person B starts a new set of changes on the active version in development. Person B tests and moves his/her changes to production and has to deal with the not so nice consequences of also moving person A’s changes. (Now, there are those who may argue correctly that there is a process gap, improper quality control and human error but leave that aside for now. Also, I am strong believer in automation to overcome the human element).
Here’s how you prevent this from happening again: all it takes is a well placed exit enhanced with the code below. The code compares the local versions with the version stored in the production system. It takes the latest development version and works backwards till it finds a version that matches production. As an example, for the following program –
Check if active version matches production
Check if modif version matches production
Check if version 4 matches production
Check if version 3 matches production….and so on, resulting in
The code is attached.
Right now the code works for the ABAP Editor (SE38): Relevant Enhancement Spot: SEUED001, Component: EXIT_SAPLS38E_001. The exit is triggered when the editor is invoked, so this works automatically for all programs you try to edit.
Finally, I believe it should be trivial to adapt this code to Class Editor or Print workbench or whatever else you can think of. That and the task of identifying the proper exits are left as an exercise for the reader 😀 . It would be great if a common exit could be found for all objects.
Please add your improvements and let know if useful. One known limitation is this gets called multiple times if you are jumping around in the edit mode and the object is not locked in any transport. There are ways around it but I haven’t gotten around to adding the relevant code.
TIP: For SE37, try SEU00004 -> EXIT_SAPMS38L_001
P.S: I take a couple of shortcuts in my code, by hardcoding the production system and its RFC path. I am sure one can figure out how to make that part generic by using the SLD. However since the definition is done once per system, the tradeoff is acceptable to me.