Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Class enhancement disabling

Former Member
0 Likes
2,065

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

10 REPLIES 10
Read only

Former Member
0 Likes
1,648

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

Read only

0 Likes
1,648

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

Read only

kakshat
Product and Topic Expert
Product and Topic Expert
0 Likes
1,648

: Setting an editor lock would prevent someone other than the author to change the code. It won't deactivate the enhancement.

Read only

Former Member
0 Likes
1,648

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

Read only

0 Likes
1,648

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

Read only

0 Likes
1,648

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

Read only

0 Likes
1,648

Hello,

Could not find desactivate function in SE20.

Best regards,

Paul

Read only

Former Member
0 Likes
1,648

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

Read only

Former Member
0 Likes
1,648

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

Read only

Former Member
0 Likes
1,648

Can you try creating a switch...using this switch in propoerties of enhancment implemenation