Class Editor – Refactoring Assistant – I

By | September 20, 2011 | ABAP Objects, OO Editor tools | 9,153 | 0

While designing the application, there would be lot of instances that we need to move methods, attributes, events or types from a class to another class or an interface. Basically we need to refactor them. But we have to do it manually, it would be too costly and tedeous task when we need to do lot re-factoring. This is very simple and effective tool.

There are different scenarios when we can use Refactoring assistant. Let’s see few of them which could be used more often.

Find all the posts of Mastering the Class Editor:

Moving components from Super class to Subclass
We’ll use this class hierarchy for this demo. When we started designing, we created a single class ZCL_REPORT as shown in this UML. Now, we want to move the output related methods and attributes to the output class ZCL_REPORT_ALV. So, the final class hierarchy would look like this.

So, how we can use the refactoring assistant to do this job:

  1. Create a class ZCL_REPORT_ALV inheriting from ZCL_REPORT
  2. Change class ZCL_REPORT in SE24 and go to Utilities > Refactoring Assitant.
  3. You will be at Refactoring Assistant. Expand the tree.
  4. Drag and Drop, method GENERATE_OUTPUT and O_ALV from class ZCL_REPORT to ZCL_REPORT_ALV

This is how the class hierarchy looks after the refactoring:

In future posts, we’ll see other scenarios where we can use refactoring assistant.

Like It? Share!!

Don't miss an Update

Get notified of the new post, right into your inbox

Naimesh Patel{274 articles}

I'm SAP ABAP Consultant for more than a decade. I like to experiment with ABAP especially OO. I have been SDN Top Contributor.
Follow :

Explore all of his 274 articles.

Load comments

Comments on this Post are now closed. If you have something important to share, you can always contact me.

You seem to be new here. Subscribe to stay connected.