Skip to Content

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

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply