Skip to Content
0

ABAP Overwrite Enhancement

Jan 15 at 09:31 PM

117

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Uladzislau Pralat Jan 16 at 01:50 AM
1

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

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). The only way to prevent the enhanced method from executing is the triggering of a class-based exception.

1
Sandra Rossi Jan 16 at 01:38 PM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
Robin Wennemuth Jan 16 at 09:35 AM
-2

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Robin,

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

Regards, Uladzislau

0

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

0