cancel
Showing results for 
Search instead for 
Did you mean: 

Can use Overwrite & Post exit Method enhancement in any case

Former Member
0 Kudos

Hi all,

I've a concern when comes to the use of overwrite exit is when SAP update the code of the standard method, if the overwrite exit is not updated, it will cause problem because the updated code is not being executed. Instead if post exit, it will be executed after the standard method.

So my query is: Can we use Overwrite/Post exit in any case to enhance the standard methods?

Thanks

Sanket sethi

Accepted Solutions (1)

Accepted Solutions (1)

ChrisPaine
Active Contributor
0 Kudos

Hello,

a question more suited possibly to the general ABAP forum - but let's try to take the WD ABAP case specifically.

Of course you can enhance standard methods - but in doing so you do run the risk that your enhancement will not be compatible with any future changes to those methods. You would be well advised to wrap your enhancements in a switch framework so that they can be easily deactivated - and normal functionality resumed.

Take for example the case I have been working with recently - triggering an event from a standard dictionary value help: I could have done this by enhancing the standard code with an implicit enhancement. But then,if the flow logic of the standard code changed, I would run the risk of the change not working. Plus - if anything went wrong elsewhere in my system with a standard application and I needed SAP to connect to my system to debug the standard application - the first thing they are going to do is point out that I have non-standard enhancements in my code - and if experience is any guide - they will then refuse to go any further until those enhancements are removed. If you can then deactivate these enhancements via a switch - you can prove - both to yourself and any support team that the enhancements are not the cause of the problem.

Additionally when you start enhancing standard methods - you are making your system behave differently to everyone else's. This means that if someone who is not experienced with your particular system - and your particular changes - comes in, they may need to spend some time understanding what you have done. Depending on your support model (using external consultants etc.) this could dramatically increase your support costs.

So I resist using the enhancement framework where I can. But it is always there if there is a problem I can't solve any other way.

Chris

Former Member
0 Kudos

Hi Chris,

Thanks for your Valuable advice. I just want to confirm one thing that do I use the Overwrite enhancement instead of Post-exit enhancement as Post-exit will executed after the standard code.

Is there any harm to use the Overwrite exit, when any changes will make in Standard code. If so, always create any enhancement in Post exit?

Also can you please explain the switch framework..

Please advice.

Former Member
0 Kudos

> Thanks for your Valuable advice. I just want to confirm one thing that do I use the Overwrite enhancement instead of Post-exit enhancement as Post-exit will executed after the standard code.

> Is there any harm to use the Overwrite exit, when any changes will make in Standard code. If so, always create any enhancement in Post exit?

If you are using Overwrite Exit then it should not matter to you when standard SAP code is updated as you are always bypassing the execution of that piece of code and getting your code executed.

If you are using Post exit, then you mave have to look at your code after any upgrades as the standard method execution might change.

Lets take an example:

Suppose standard method calculates commission for an agent

it calculates 100 $ as comm

Now you have a requirement to totally change the way how commission is calculated - then you have to use overwrite exit.

In other scenario, suppose you have a requirement to additionaly give 10 $ more to agent after his commission is calculated then you would like to use Post Exit Enhancement in this case. In this post exit method you can add 10 $ to already calculated commission.

I hope the usage is clear, it majorly depends on your requirements and scenario.

There is no fixed rule or preference to use one exit type over another.

Regards

Manas Dua

ChrisPaine
Active Contributor
0 Kudos

Hi Manas,

>If you are using Overwrite Exit then it should not matter to you when standard SAP code is updated as you are always bypassing the execution of that piece of code and getting your code executed.

But what happens if the signature of the method changes? If you've overwritten a method of a class there should be no guarantee that the signature of the method (especially if it was a private method) will stay the same. Even if new optional parameters are created it would be worthwhile reviewing after any patch. No? I guess it depends where and what you are enhancing.

Former Member
0 Kudos

So the conclusion is that there is no fixed rule or preference to use one exit type over another. It always depends on where and what we are enhancing??

Answers (0)