Beginners journey into Enhancement Framework
This is a Step-by-step of my first enhancement using enhancement framework. This is written by an enhancement framework beginner and meant for beginners.
I have read some of the very good blogs and visited the wiki site in SDN. I have still struggled, and I’m sure I will continue to struggle with implicit and explicit enhancements. This is my attempt to highlight some of the pain points.
First some background:
My company is moving from 4.6C to ECC. The new enhancement framework will allow us to remove some of the cloned programs we have. Our definition of cloned is coping the SAP program and then making changes to it. It sounded like a good idea at the time. There would be no modification to core SAP. Now every upgrade, and sometimes notes are applied our cloned programs may need to be modified. Hence, we had good reason to look into the “new” and improved way of modifying SAP code. I and a co-worker were the ones to explore the new way of doing things. I will not divulge her identity.
And so my journey began:
It was one of those good days. No user calls. There was plenty of time for new development. And I had time to work on integrating the new technology with the old development.
All right! I thought to myself. Enhancement Framework. It’s the NEW way of doing things. How hard can this be? I’ve read about it. I’ve done some basic research. I’m ready! I can easily create an enhancement. I was very confident that everything would work. Maybe a little struggle, but this was SAP. It was ABAP, and I’ve been doing it for a while now. It might take a little bit, but I could make it happen!
That optimism was very short lived. In approximately one day, I took down all of our custom transactions on our development box. Ouch.
How did I do it you ask? Here’s how. Do not do this at home.
I began by looking for a place to put some custom logic for PO printing. It did seem like an easy thing to do.
1. I found what looked like a great place to include my enhancement. It was an enhancement that was already a part of the code.
2. I then entered in my code in between the enhancement and end enhancement. That took a while. I kept having problems with the editing of enhancements.
3. I tested my code in debug. It kept skipping over my custom code. What was up?
4. Next I double clicked on the enhancement. I found that under the properties of the ISAUTO_SCH_EMM_SAPLMEDRUCK enhancement there was a switch. Switch AM_SCH_MM. The switch was turned off. Aha! That was why the code was being skipped. The enhancement was turned off.
5. So I switched it on! Makes sense, right? That shouldn’t cause issues. I switched it on, and saved the changes in the package where all my custom development was saved.
6. Now once I had switched the switch on, strange things started to happen. So I switched it off, and went home for the day. Did I mention I come into work early and leave early? That is a really good fact to know. Because there still were a lot of people here when I left.
The next day, I found a lot of e-mail going back and forth about all of the custom programs not working. What! It couldn’t have been anything I had done. Something else must have happened.
Well, I started digging. The more I looked, the more I saw my user name. I noticed that I had inactivated my entire package when inactivating the switch. Not good.
It seems that I attached the switch to my package. So now the switched worked on the package. When it was switched off, it was off! None of the custom transactions worked.
Lucky for me I remembered how to move the system back to the original state. I sort of remembered. It took me a while but I got it back. I did get it back prior to the rest of the people getting in, and that was good.
I deleted the switch from my package. I deleted my code from the enhancement. And like magic, my custom transaction started working again!
Now I thought that I would wait until my hands-on at SAP TechEd prior to doing anything with Enhancement framework. In the meantime, I did some research on SDN. There are many blogs that are listed in the Enhancement Framework WIKI.
The blogs were excellent. TechEd taught me even more. I was tentative after my first experience. But I was ready to try my first enhancement. Maybe?
The journey continued:
Here are my steps to implementing an implicit enhancement. (These you can do at home.)
1. First, I displayed the function module source code. I clicked on the spiral, enhance source code, button.
2. Then I wanted to find the implicit enhancements. I went to the menu, edit -> Enhancement Operations -> Show Implicit Enhancement Options.
3. Next I wanted to create my enhancement. I right clicked on the line where I wanted my enhancement. OK, the line where I wanted my enhancement, and where the implicit option was available. The implicit options are available anywhere where there are the “”” that go across the page. After I right clicked, I clicked on enhancement implementation -> Create.
4. The enhancement list came up. At this point I could select an enhancement that was already there, or create my own. I created my own, by clicking on the create button.
5. I entered the name of the implementation Z_MM_XXXXX, and a short text. I was grouping this enhancement with enhancements that I would be making in other programs. I also created a composite enhancement. Z_MM_COMP_XXX.
6. I entered my code. Then, I simply activate the enhancement changes. It worked!
The review of the journey:
It seems easy now. I look back at the steps, and think about how easy it could have been. I’m sure I’ll learn even more as I use it. I had some pain points when doing the enhancement “correctly”. Here are three of them.
1. I had trouble modifying the enhancement change. It seemed to me like once I displayed the code, it would be a simple matter of changing the enhancement. It would just display open for changes, once I switched to enhancement mode. That was not what happened. I had to switch to enhancement mode. I got that much right. Then right click on the text “enhancement”. Enhancement implementation -> change.
2. I wanted to group the enhancements from different programs together. I thought I could just use one enhancement for several different programs. I found, as I went from program to program that I could not select the enhancement. The enhancement was linked with the program where the changes were made. I fixed that in the steps above by creating a composite enhancement.
3. Deleting the enhancement once it was created was interesting. For that I ended up going to the object navigator and deleting it there.
Hopefully my experience can help someone else out. My lesson learned was the best idea is to hit an SAP training class. I knew that. However, sometimes the timing is not right. SAP TechEd was a great place to start learning. There is a lot of knowledge at SDN.