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

ABAP Overwrite Enhancement

robinwennemuth
Explorer
0 Likes
5,813

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
Read only

Sandra_Rossi
Active Contributor
4,040

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.

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

6 REPLIES 6
Read only

uladzislau_pralat
Contributor
4,040

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

Read only

4,040

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.

Read only

robinwennemuth
Explorer
0 Likes
4,040

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

Read only

0 Likes
4,040

Hi Robin,

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

Regards, Uladzislau

Read only

0 Likes
4,040

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

Read only

Sandra_Rossi
Active Contributor
4,041

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.