The enhancements to global classes and interfaces can be separated into:
● Enhancements to the source code of methods, local classes, and so on – these enhancements are carried out by means of ABAP Source Code Enhancements.
No source code enhancements are allowed within interface sections and class sections. The only exception are implicit enhancement options at the end of types.
● Enhancements to components of classes and interfaces
You can enhance the components of a global class or global interface by:
● Inserting new attributes
● Inserting new optional formal parameters to existing methods (but no new exceptions)
● Adding the implementation of a pre and/or post method for an existing method of a class. A pre-method is called directly after the call of the existing method before the first statement. A post-method is called after the last statement of the existing method before ENDMETHOD(only if the method is exited using ENDMETHOD).
○ The chain pre-method → method xyz → post-method can be interrupted at runtime (parts are not executed) under the following circumstances:
○ If an exception is raised within the pre-method, the method xyz and the post-method are not executed.
○ If an exception is thrown in the method xyz, the post-method is not executed.
Starting with SAP NetWeaver 7.0 Enhancement Package 1 and SAP NetWeaver 7.1 Enhancement Package 1, statements like CHECK, EXIT and RETURN used within the method xyz do not stop the post-method from being executed. For more information, see SAP Note 1083387.
● Adding the implementation of an overwrite-method for an existing method of a class. The creation/deletion is similar to the pre or post methods. However, an overwrite method is executed instead of the original method. When an overwrite method is created, it is not allowed to have pre or post methods for the same original method.
● Inserting new methods.