Things that would make our life easier when working with Eclipse
I am working with ABAP in Eclipse for quite a while now and luckily most of our customers have later Netweaver release that supports eclipse with its latest features. I usually work with ABAP OO only and I can ignore the existance of some older concepts (forms, screens etc.). I really love the capabilities of eclipse in its current version for ABAP OO objects and I can actually feel that my development speed has distinctly increased compared to SAP GUI. Nevertheless, there are some features that would very nice to have. I actually have a list of over 20 items. That would be definitly to much for a single blog post. So, I will start with the quick-fix and editor related items. Hopefully a member of the ABAP in Eclipse developer team is reading this 😀
1.) When create a new global variable of a class (static or instance) via quick-fix there is only an option for creating it private.
When I want to have protected/public variable I have to create a private one first, navigate to it and change it’s visibilty using another quick-fix. So, a lot of clicks for a very simple operation are necessary. Since protected is the preferred option in most cases for any developer who actually cares about visiblitly this is very annoying. Why should I explicitly prevent others from inheriting from my class and chosing a variable private? That just makes sense in very special cases. Therefore, default for the quick-fix should either be protected (instead of private) or even better all options (public/protected/private) should be offered as quick-fix.
2.) When a new class is created using the wizard there is no chance to remove the final flag. You have to manually remove it in the source code.
For modern object-oriented APIs there is almost no case where I can image that a final class makes sense. Therefore, the wizard should either offer a checkbox to set a class explicitly to final (it should NOT be checked by default) or create the class without the final additon by default. If someone really wants to have it final the “final” addition in the source code can be added manually. That was also one of the most annoying things in se24 class builder. Classes are set to “final” by default. Therefore, a lot of SAP standard classes have this flag though SAP does not want to prevent anyone from inheriting of their class. We usually have to open a SAP OSS ticket for this and the flag is removed by SAP in standard…I think I have opened more than 20 tickets just because of this flag.
3.) When a class inherits from a superclass it’s often necessary to redefine some methods. It would be very helpful to have a quick-fix that offers a redefinition of all public/protected methods of all super classes. If you are in the scope of the subclass it’s not easy to get an overview of all existing super methods that could potentially be redefined without doing some navigation. If the super classes are very big this could lead to a lot of quick-fix entries. Maybe it would be better to have a single quick-fix entry like “create a redefinition” and it opens a wizard that shows all the public/protected methods of the super classes and one can chose some of them.
4.) Very similar to 3.). When I accidently add a redefinition of a protected method to the public section I get the following ABAP error:
Quick-fix offers the follwing items:
“Add implementation” makes no sense in this case. There cannot be a method of the same name in the sub-class (remember that copy_rights_from_ip is a protected method of the super class). There should be an option like “Make copy_rights_from_ip protected”.
5.) When you have to deal with a varibale defined as a table type in the code there is no easy way to navigate to the underlying workarea. Example:
“crmt_orderadm_i_wrkt” is a table type and it’s underlying workarea is not 100% compatible with DB table crmd_orderadm_i. When I click F2 on “crmt_orderadm_i_wrkt” in the code the following popup opens:
What I actually want to see are the components of the structure “crmt_orderadm_i_wrk” (note the missing “t” at the end).
My workarounds here are either to copy the workarea name and open this object manually via CTRL+SHIFT+A or open the table type from the source code with F3 and double-click on the workarea name in SAP GUI.
It would be more convenient if it could be opened with F3 directly from the popup or the workarea information could be displayed with F2 from the popup. I do not really want to open SAP GUI here. I basically want this view:
5.) It would be very nice to have the possiblity to create getter/setter methods via quickfix (for single attributes by using the quick-fix on a specific attribute and for all attributes by using the quick-fix on the class name).
6.) It would be nice to offer a possibilty to create an abstract class in the wizard for creating classes. I guess this should be easy to implement.
7.) When using the quick-fix to generate a factory methods the old ABAP syntax for object creation “CREATE OBJECT” is used. I would prefer to use the new syntax “NEW” instead (this is just a personal preference).
I think that’s enough for today. I would be very happy about some feedback 😀 .