2018 Jan 15 9:31 PM
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
2018 Jan 16 1:38 PM
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.
2018 Jan 16 1:50 AM
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
2018 Jan 16 1:32 PM
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.
2018 Jan 16 9:35 AM
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
2018 Jan 16 10:25 AM
Hi Robin,
I used described approach with EXIT statement in implicit pre-method to conditionally bypass standard method implementation.
Regards, Uladzislau
2018 Jan 16 1:26 PM
Please move your reply under Uladzislau's answer, by using "Convert into Comment"
2018 Jan 16 1:38 PM
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.