CRM and CX Blogs by Members
Find insights on SAP customer relationship management and customer experience products in blog posts from community members. Post your own perspective today!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos
630

If you need to redefine a method because you want to alter the standard behavior of the system, you should always first 'enhance the component and enhance the view'. When enhancing, the system generates enherited z-classes containing only inherited methods. How to redefine a view can be found here.

If you want to alter the coding of the standard, you can now redefine an inherited method. Redefining means that the system no longer calls the standard class, but your redefined class.

It is recommended to always call the standard coding either in the beginning of the redefined class or in the end, depending on what kind of alteration you are planning. This way, if the standard functionality changes, your code still calls this changed functionality.

The standard (inherited) method can always be called using ABAP coding:

CALL METHOD super->[NAME OF THE CURRENT METHOD]

    EXPORTING

        [IMPORTING PARAMETERS] = [IMPORTING PARAMETERS]

    IMPORTING

        [EXPORTING PARAMETERS] = [EXPORTING PARAMETERS]

Of course if there are no parameters, the importing and exporting parameters can be left out.

Example:

CALL METHOD super->do_prepare_output

    EXPORTING

        iv_first_time = iv_first_time.

This method calls the do_prepare_output of the parent class.

Source: http://blog.acorel.nl/2010/08/redefining-method-of-view.html

Labels in this area