Application Development 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: 

How to make a Class Enhancement Implementation not run?

Former Member
0 Kudos

HI Gurus,

I enhanced a standard Class, to created a over-write method. But Now i do not want this implementation run,

how to make it? And I do not want delete it at all.

I tried inactivate the enhancement implementation also inactivete that method. But still run the old active one.

Thank you.

regards,

Archer

1 ACCEPTED SOLUTION

0 Kudos

Hello

In the Enhancement you can use switches to activate/deactivate enhancements:

In the property-Section of the Enhancement you can enter a switch.

It is possible to create own switches and use them in own enhancements, but I don't know how to create, because I never needed.

I am not sure, but I think, that switches can only be activate one time and then you can not deactivate them again.

Otherwise I would comment the Code or, if you need to change it often, write a Method or function to check, if your implementation is active or inactive at the moment. Use the Name of the Enhancement as a Parameter and you can reuse this method, if you need it in an other enhancement.

regards,

Peer.

9 REPLIES 9

Former Member
0 Kudos

Hi,

Have u tried commenting all of your custom code and activate?

Former Member
0 Kudos

Hi,

I suggest you to delete over-write method as it over writes the standard execution methodology of that method i.e it act as a replacement at run time for the original method

Thanks

KH

0 Kudos

Is there a way like in new BADI, you can setting the 'Runtime behavior', run or not run.

If have no choose, i only to delete my over-wirte method. But after deleted, i want run my over-write method, recreate it again? Does not make sence.

Regards,
Archer

0 Kudos

You can create a custom kernel BADI and put your code inside one of the implementation of that BADI Method and then you can easily activate / Deactivate the code. But transport dependency will anyway be there.

And obviously call the Code by GET BADI and CALL BADI options.

R

former_member205488
Active Participant
0 Kudos

Hello!

Run transaction SE20, find your enhancement and try to deactivate it.

0 Kudos

hi Vadim, i tired this and even deactivate my over-write method. Still run previous active one version.

Former Member
0 Kudos

Dengyong,

What about the possibility of creating a pre method and control the execution of the over write method thru the pre method?

V.

0 Kudos

Hello

In the Enhancement you can use switches to activate/deactivate enhancements:

In the property-Section of the Enhancement you can enter a switch.

It is possible to create own switches and use them in own enhancements, but I don't know how to create, because I never needed.

I am not sure, but I think, that switches can only be activate one time and then you can not deactivate them again.

Otherwise I would comment the Code or, if you need to change it often, write a Method or function to check, if your implementation is active or inactive at the moment. Use the Name of the Enhancement as a Parameter and you can reuse this method, if you need it in an other enhancement.

regards,

Peer.

0 Kudos

Hi Peer,

Seems a 'switch' is that wanted.

I tried create my own switch and assigned that package where implementation at, create business function and set also. But fail at SFW5, 'No Authorization' to set switch status on.    "Who is SAP_ALL, f......g out".

I need fighting more on switch framework. Do not want develop more code to control it. i`m lazy.

Thanks all.

Regards,
Archer