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: 

ABAP Overwrite Enhancement

robinwennemuth
Explorer
0 Kudos
3,599

Hey Guys,

just a simple Question:

If I have a SAP Standard class and implement an Overwrite Exit. Is it possible to call the Original implementation of the SAP standard?

My customer requests every Enhancement to be deactivated on Demand by editing some Custom Table parameters, and I would like to tie the Activity status to my Enhancement run.

I have already implemented this kind of conditional Enhancement in an Web Dynpro Component Overwrite Enhancement by calling me->method( ) in order to refer to the Original implementation.

Thanks!

Robin

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
1,826

You may implement the implicit enhancement point at the beginning of the method (whirlpool icon + context menu to firstly display the implicit points and secondly create implementation). As the code is inserted directly in the body of the method, the RETURN statement (EXIT being recommended only for leaving loops) will leave the enhanced method.

6 REPLIES 6

uladzislau_pralat
Contributor
1,826

Hi Robin,

I would rather implement before exit. In before exit I can check user condition and execute EXIT command to skip standard method implementation or if needed continue with standard method execution.

Regards, Uladzislau

1,826

Within a pre-method, EXIT does not prevent the standard method from executing (because a pre-method is coded in its own method, so EXIT (or preferrably RETURN) will only exit the pre-method). Within a pre-method, the only way to prevent the enhanced method from executing is the triggering of a brutal stop (like the triggering a class-based exception); of course the consequence is huge and often it's not advisable to do it.

robinwennemuth
Explorer
0 Kudos
1,826

Hey Uladzislau,

thanks for your suggestion.

Would this work for an explicit Pre-Exit Enhancement for a method? I´d suppose a RETURN or EXIT statement within a Pre-Exit would just leave this procedure, but would not abort the processing of the standard method.

Or would this suggestion rather work for implicit enhancements?

Thanks,

Robin

0 Kudos
1,826

Hi Robin,

I used described approach with EXIT statement in implicit pre-method to conditionally bypass standard method implementation.

Regards, Uladzislau

0 Kudos
1,826

Please move your reply under Uladzislau's answer, by using "Convert into Comment"

Sandra_Rossi
Active Contributor
1,827

You may implement the implicit enhancement point at the beginning of the method (whirlpool icon + context menu to firstly display the implicit points and secondly create implementation). As the code is inserted directly in the body of the method, the RETURN statement (EXIT being recommended only for leaving loops) will leave the enhanced method.