Skip to Content
Technical Articles

Comments for the ADT Quick Fixes

ABAP Development Tools in Eclipse enable the automated adaptation of custom code for SAP S/4HANA with only a few clicks through Quick Fixes. These can resolve the most frequent findings such as ORDER_BY issues, MATNR issues, and issues related to data model changes such as KONV, BSEG, and others. Mass-enabled Quick Fixes significantly reduce your custom code adaptation efforts by allowing to apply the Quick Fixes for the whole ATC findings list at one shot. See also the blog Semi-automatic custom code adaptation after SAP S/4HANA system conversion.

If you apply mass-enabled Quick Fixes you can display for each your custom code object the source code before (“Original Source”) and after (“Refactored Source”) the Quick Fix:

Very often we’ve got the question from the customers: will there will be comments added to the refactored code in order to be able to reproduce how the source code looked before applying the Quick Fix?

With the SAP Note 2902053 you can now get for each Quick Fix a source code comment in your refactored code on your SAP S/4HANA 1909 system. In order to use the new functionality you have to activate it in the system via the report SATC_AC_QFIX_COMMENTS_ENABLED.

CURRENT LIMITATION: Quick Fix comments are currently available only for transportable objects. It is not possible to apply them for local objects.

NOTE: Enabling Quick Fix comments is an optional feature and should be used only if it is absolutely necessary to keep the old source code parts since it is not in line with “Clean Code” principles.

The source code comment contains the following information:

  • Textual description of the applied Quick Fix, e.g. “Quick Fix Append ORDER BY PRIMARY KEY to the SELECT statement”
  • Your old source code before the Quick Fix
  • ID of related transport request
  • Description from the related transport request

Here you see an example how it works. A comment section is placed on top of the changed code (via Quick Fix) where you see the old code (lines 35-38) and an explanation which Quick fix was applied, in this case “Replace VBUK table access with the access of compatibility view V_VBUK_S4”. In addition, the ID and the description of the corresponding transport request is provided in the comment:

Just try it out!

4 Comments
You must be Logged on to comment or reply to a post.
  • Hello!

    Would the changes not be captured automatically by the version control system i.e. you could see what the code used to look like by comparing versions?

    The reason I say this is that “Clean Code” principles aim for not having any commented code at all.

    In his book Robert Martin describes commented code as an abomination that gets less relevant with every day that passes. I would tend to agree.

    I have had people say to me where I work that they are just going to keep the commented code in for “a while” so they can easily see how it used to look. Ten years later it is still there, and the real code is hiding in small islands between pages of commented code.

    For the above screen shot it looks like the transport number is automatically added as well. Oh dear. That sort of thing also gets a hammering in the Clean Code book.

    That (transport number) is definitely captured by the version control system.

    Cheersy Cheers

    Paul

    • Good comment. The thing with the “small islands of active code” is really a problem. In the past I had serious discussions about “if you are sure, you can remove the code instead of commenting”. The point was that developers don’t seem to be sure and don’t trust version control system.

      By the way: In SAPscript forms, for inexplicable reasons, you will find a lot more commented statements. Sometimes windows are just full comments, no active statement. For whatever reason…

  • Hi Paul,

    you are absolutely right and that’s the reason why the feature is optional and needs to be switched-on before using it.

    We often have project setups where implementation partners are doing the code adjustment for the customer. For these scenario we got the request to include these kind of code markers.

    Regards,

    Thomas.