Application Development 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: 

what is pre-method for, versus "begin source enhancement" in method?

Sandra_Rossi
Active Contributor
0 Kudos

Hi,

I use new enhancement framework (sap 7.0). Today I discovered the existence of pre-methods, but I don't understand in what situation we should use them, as "usual" source enhancements at the top of a method are equivalent, and so they are sufficient.

The only important difference I saw is that the pre-methods can only use public attributes and methods, whileas source enhancements can work also on private and protected members.

So, do you know what they are for?

thx a lot!

sandra

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
0 Kudos

I want to share my experience :

-- For both, we can add several implementations, but when we use pre-methods (or post-methods), we only see the code of one implementation at a time (moreover we don't see the main method code in the meantime), whileas implicit enhancement points are all displayed along with the main method code.

-- With 7.0, we can't use Pretty printer with implicit enhancement points, but we can with pre-methods (or post-methods)

Edited by: Sandra Rossi on Nov 26, 2009 1:12 PM below

-- As of 7.01 (but not in 7.0) there is a difference between implicit enhancement option at the end of a method AND the post-method : if a CHECK, EXIT or RETURN occurs in the method, the post method will be executed while the implicit enhancement option won't (see Note 1083387 - Execution of post enhancement methods). In 7.0 both implicit enhancement option at endmethod and the post-method were not executed in that situation.

2 REPLIES 2

Sandra_Rossi
Active Contributor
0 Kudos

still no idea?

Sandra_Rossi
Active Contributor
0 Kudos

I want to share my experience :

-- For both, we can add several implementations, but when we use pre-methods (or post-methods), we only see the code of one implementation at a time (moreover we don't see the main method code in the meantime), whileas implicit enhancement points are all displayed along with the main method code.

-- With 7.0, we can't use Pretty printer with implicit enhancement points, but we can with pre-methods (or post-methods)

Edited by: Sandra Rossi on Nov 26, 2009 1:12 PM below

-- As of 7.01 (but not in 7.0) there is a difference between implicit enhancement option at the end of a method AND the post-method : if a CHECK, EXIT or RETURN occurs in the method, the post method will be executed while the implicit enhancement option won't (see Note 1083387 - Execution of post enhancement methods). In 7.0 both implicit enhancement option at endmethod and the post-method were not executed in that situation.