‎2013 Feb 07 2:01 PM
Dear SAP community,
I was wondering if it is possible to disable a class enhancement?
For example, I created an enhancement for my class ZPB_CLASS where I added an overwrite for a method TEST. This is working perfectly but I could not find any way to disable this enhancement without destroying the entire overwrite definition.
Thanks in advance,
Paul
‎2013 Feb 07 6:20 PM
hello,
Not sure if that can be achieved. But you could do something like editor lock that you do in SE38.
You can "editor lock" methods on an individual basis. Select the method in the Class Builder screen, then select the "Detail view" icon in toolbar (looks like a jigsaw puzzle piece). In the popup that follows, you can set editor lock via checkbox.
Not found a way to protect the Public, Protected & Private code sections, though, so you can't stop someone changing method or attribute definitions.
best regards,
swanand
‎2013 Feb 07 8:28 PM
Hello Swanand,
Thanks for your answer but I am just looking for an option I might have missed in the enhancement options that would allow me to do this in a clean way (a disable button), just like it is possible to disable BADI implementations in Enhancement spots.
Best regards,
Paul
‎2013 Feb 08 4:02 AM
‎2013 Feb 07 7:51 PM
Hi,
Quite possible that my solution could be worst in terms. However for a quick work around you can try keeping a condition like check 1 = 2 on top of enhancement. I guess i might have misunderstood the requirement.
Regards,
Vishal
Happy ABAPing
‎2013 Feb 07 8:29 PM
Hello Vishal,
Thanks for your answer but this would just prevent the code within the method to be run. I want to deactivate the overwrite so that at runtime the original code is run.
Best regards,
Paul
‎2013 Feb 07 8:50 PM
Hello.
Why dont you desactive the enhancement? Using tcode SE20 modify the enhancement and desactive, so if wont run over runtime and the original code will run.
Is it sth like that what u need?
Regards
‎2013 Feb 08 7:18 AM
Hello,
Could not find desactivate function in SE20.
Best regards,
Paul
‎2013 Feb 08 5:07 AM
Hi Experts,
I don't have much experience and have not worked on class enhancement. If it is possible to comment the code, you can deactivate it.
Please correct me if I am wrong.
Regards
Purnand
‎2013 Feb 09 7:11 AM
Hi,
When performing such enancements, never delete the previous code always comment it out so that when you have to de activate the enhancement you can simply comment out your enhancement code and uncomment the original code.
Regards,
Ashish
‎2013 Feb 12 9:30 AM
Can you try creating a switch...using this switch in propoerties of enhancment implemenation