Skip to Content
Technical Articles

Remote Code Analysis in ATC – Working with Baseline to suppress findings in old legacy code

This is the third blog of the blog series about Remote Code Analysis in ABAP Test Cockpit (ATC).

See also blogs:

Working with Baseline – Live Demo

If you are interested in the live demonstration of working with baseline watch this YouTube Video on abap channel

 

Baseline concept – Focus on new or recently changed code

This problem knows almost everybody, who takes care of code quality in the SAP system landscape. At the latest you get in touch with this problem as soon as you run ATC for your whole custom code. Then you will namely get very many findings especially if you apply all standard checks like naming conventions, SLIN checks, performance checks, security checks and so on:

What to do with this long list of findings? Actually you have a lot of legacy custom code in your landscape and want now to focus your quality assurance efforts only on the new or recently changed code.

The baseline concept (available with SAP NetWeaver AS for ABAP 7.51 innovation package) offers you a solution. With baseline you can exclude after the first ATC run your well-known or legacy findings from the ATC result list (add the ATC results to the baseline) so that at the second ATC run they will be treated as a special kind of exemption and will not appear in your ATC result list. Of course you can anytime change the scope of the baseline (add or remove findings) and in this way you can always very flexible decide which findings you want to take care of.

The setup of the baseline is quite simple. You need to logon to the ATC system as administrator. In the transaction ATC under ATC Administration -> Runs double-click the Manage Results entry. In the ATC: Browse Results screen you can specify the query for ATC run series and visibility of results and press Execute button or F8. The ATC result list displays the results according to your specified query settings.

Now you can add (or remove) findings to baseline after selecting the relevant finding from the results (Baseline -> Add to Baseline to…) and by choosing the appropriate option for it (suppress, exempt, assign low priority).

After this the ATC check result gets added to the baseline (this is indicated by column Is in Baseline):

After this you can schedule a new ATC check run, and you will see, that the ATC result contains no findings (double-click the result to see the findings list):

Optionally you can still display the suppressed findings (findings which are now in the baseline):

Note: as long as you only change coding that does not affect the exempted finding (for example you change something in line 20 of an INCLUDE and the finding marks code in line 200), the exempted finding is still recognized as the same.

If you now for example change the source code and schedule the ATC check run again, the new ATC result will contain only the new findings:

 

Further information

Further details on the baseline concept are available in the documentation on SAP Help Portal: Working with the Baseline in ATC.

 

41 Comments
You must be Logged on to comment or reply to a post.
  • hi Olga,
    seems to be a great option to do central code checks. Unfortunately we do not have 7.51 yet 🙁

    Regarding that check-topic I have a question: currently we develop with 7.40 (and rather new ABAP-keywords thanks to the nice blog posts of Horst Keller). When we want to transfer the code to an older system (e.g. 7.02 where ABAP is rather ‘retro’) it happens that import fails because the old system cannot generate due to unknown keywords/syntax.
    Is there an option to check ABAP-code in a new system e.g. 7.40 with the notion “the code should be syntax-error-free in 7.02”?
    Any hint appreciated.
    br
    chris

  • Hi Olga

    I have created a baseline for a 7.01 system via the Central ATC system.  When running a scan on a transport in the local 7.01 system using a central RFC variant, the baseline is not reflected. Is this because the baseline is not considered for local systems that do not have the ATC ?

    Regards

    Ian

     

    • Hi Ian,

      yes, exactly, baseline is the ATC feature. If you scan your 7.01 system from the central ATC system, the baseline will be considered.

      Regards,

      Olga.

  • Hi Olga

    Thanks for the prompt response.

    We will schedule a twice weekly job on the Central ATC system to check the delta changes then and run adhoc scans from here instead.

    Thanks

    Ian

  • Hi Olga,

    Suppose I add around 20 lines of code in between for an include, then all the below code will be shifted by 20 lines down. In such cases, since the line numbers have changed for the old code – will the ATC issues for these codes will start showing up even though I base-lined it earlier ?

    • Hi Rao,

      please see the answer above in the blog:

      Note: as long as you only change coding that does not affect the exempted finding (for example you change something in line 20 of an INCLUDE and the finding marks code in line 200), the exempted finding is still recognized as the same.

      Regards,

      Olga.

       

       

  • Hi Olga

    Previously we established that the baseline is not considered when scanning from a 7.01 system and using the RFC variant from the Central ATC.

    I have now created a baseline for a system that has a local ATC and scanned from local ATC to central ATC using the same RFC based variant.  This time the baseline is considered as expected, however in the Exemption State column, it says Has Pragma as a tooltip on the displayed icon – which is confusing.

    I was expecting a green light and a tooltip that says ‘Approved’ instead.

    Can you advise?

    Thanks

    Ian

     

    • Hi Ian,

      I suspect that the findings with the “Has Pragma” exemption state have been exempted via pseudo-comment (not the baseline). I will address it at development.

      Thanks and regards,

      Olga.

       

  • Hi Olga,

     

    Thanks for the post. I have a situation. We have a central ATC system NW 7.52 SP 01(01/2018) .

    I am trying to set up ATC there . I am tryinng to pushthe ATC results from Central system to Satelllite Systems. However I dont see button to replicate my Central ATC results to Satellite Systems

    Could you pls help

     

    I do see Replicate targets option –

    Thanks,

    Rini

  • Hi Olga,

    Based on the described concept, it seems that we could used this functionality to check only new code of a program:

    However, I´m trying the baseline functionality and I could not get it to work properly.

    For example PROG ZABC:

    SELECT * FROM TAB.

    In a first ATC (1) run we have one finding and I add it to baseline.

    If I run ATC (2) again there is no finding.

    Now, I change PROG ZABC by adding a new statement to the end of the code (and not affecting the previous exempted finding):

    SELECT * FROM TAB.
    SELECT * FROM TAB2. –> new code

    When I run ATC (3) now we have two findings.

    So, until ATC run (2) everything was fine. For ATC run (3) I expected to see only one finding related to the new code, however the previously exempted finding is now there again. Perhaps I am I missing something? Or did I misunderstood this part related to new code?

    Best regards,
    Kendy

    • Hi Kendy,

      the baseline is effective as long as the related code sections remain unchanged: if the code is changed or a new code is added, the unique identifier for each ATC finding changes so that it does not match any more with the finding that has been added to the baseline. Therefore you get the finding again if you add a new line. The example from the blog relates to the source code change within the INCLUDE program which is used within the source code program, that is checked with ATC. In this case the source code program itself remains unchanged.

      Best regards,

      Olga.

  • Hi Olga,

    I’m in the process to set up our central ATC-system and am currently prototyping relevant settings with the help of a sandbox system. I’m about to create the baseline findings and am wondering if the parameter “Life Span in Days” has any bearings for how long it may be available?

    At a guess, including the results of the run in the baseline will overwrite the expiration date of the ATC-results, but I’d like to make sure.

    Cheers

    Baerbel

     

    • Hi Baerbel,

      the life span (= exprires after … days) defines how long an ATC result shall exist.After the life span has been exceeded an ATC result can be deleted automatically, e.g. an ATC result with the life span 28 days is visible for 4 weeks.

      Best regards,

      Olga.

      • Thanks for the quick response, Olga! I was however already aware of that (I do tend to read documentation 🙂).

        What I’m actually wondering is how a “life span” fits with the results being marked as “add to baseline”. Does this render the expiration date moot as it would be rather beside the point for ATC-results used in the baseline to have an expiration date? Those results should actually be in the system until they get taken out of the baseline again, shouldn’t they?

        I checked the F1-help for the relevant fields but didn’t see anything spelled out there.

        Cheers

        Baerbel

         

  • Hi Bärbel,

    a result which was added to the baseline will not be deleted. You are totally right, that would not make much sense. If you remove it from baseline, it is again handled like any result and would be deleted when the clean up functionality runs again.

    Thanks for the hint! We will add a note to the documentation.

    Best regards,

    Thomas

  • I’m currently fine-tuning ATC-checks after defining the baseline and am therefore taking a fairly close look at the results for unresolved and exempted findings. The way these get displayed is a bit confusing because the icon shown for the exempted fndings shows “Has Pragma” as its text whereas there actually is no “pragma” or pseudo-comment for the specific finding:

    Actual code without any pragma/pseudo-comment:

    The finding is however included in the baseline defined via the central ATC system. Shouldn’t the icon therefore indicate this with “In Baseline” (or something similar) in the text instead of the misleading “Has Pragma”?

    I already tried finding an OSS-Note for this but wasn’t lucky and before I open a message, I’d like to know if others see a misleading icon as well or not.

    Our central ATC-system is on the latest release NW 7.52 and the satellite system is on NW 7.50/EHP 8.

    Cheers

    Baerbel

    • Here is a quick update:

      I turned this comment into a question on Q&A and after not getting answers there, raised it as an OSS message. The issue has been recognized by SAP as something in need of fixing but the correction is more than a simple bug fix and therefore will take some time. I’ll add updates to my question in Q&A as I get them.

      Cheers

      Baerbel

  • For anybody interested in an actual implementation of central ATC-checks and using the baseline concept, my blog post about Tweaking the settings to our liking might be of interest. We for example didn’t include checks for findings we wanted to highlight even if they occurred in already existing code (like e.g. hard table updates to standard tables).

    Cheers

    Baerbel

     

    • Hi Ian,

      just to make sure: with “object within repair tasks” you mean modified SAP objects?

      In general, the baseline does not contain objects but findings. If the findings in the object in the repair task have been found before in an ATC run that was added to the baseline, then these findings are also part of the baseline.

      Best regards,

      Thomas

      • Hi Thomas

        We have all too often situations where repairs are created on custom objects due to wraparounds in 2 track landscapes (project/production) and the object directory settings not being correct.

        I ask as it appears that although I am scanning all Z and customer namespaced objects, and then applying a baseline, I still get objects with findings that I would expect would have been previously found.  Recently, I have come across 2 repair tasks including custom objects with findings I would have expected to have been included in a baseline and hence wondered if there was a restriction.

        Regards

        Ian

  • Hi Olga/Thomas

    In addition to the above comment, we are also seeing occurrences where the baseline has been applied (this is after a full system scan btw – so against all custom code in the system) but within a function group, some findings have had the baseline applied and some not. See below screenshot.

    At first I thought this may be due to the ‘Cannot be hidden using a pragma or pseudo-comment’ but on seeing other findings that had not been ‘baselined’, this does not hold true.

    Below is another example where there are 5 findings hidden by the baseline but the sixth isn’t. Therefore, we have had to create our own exemption for this. The FM in question has not been changed since 2016.

    Naturally, the developers are starting to get a bit annoyed with creating exemptions for findings that are nothing to do with them, in includes that they have not touched – especially after I said to them that this would not occur due to the baseline.

    Are you able to provide a list of situations where the baseline will not be applied to findings?

    Regards

    Ian

  • Hello,

    is there any Option to use the Baseline concept also in a 7.50 System ? Are there any Pre-Corrections which we can use for this Release ?
    The problem ist that we just have made an Update to 7.50 and have no Option to do the next Update to 7.51 or 7.52 in the next months.

    Best regards

    Mario

     

    • Hi Srinivas,

      it depends on how your ATC system setup looks like. E.g. if you use your quality system as an ATC central system and run ATC remote checks for your dev system, then you can create a baseline on your quality system and take the ATC findings from the dev system over into it.

      Regards,

      Olga.

      • Hi Olga,

         

        Thanks for prompt response.

        So as long ATC Central system has findings and baseline , those will be ignored in all the checked systems. correct me if I am wrong.

        We have separate system and it acts as ATC Central system, from there it connects to several quality and dev systems using RFC stubs. In this architecture , one quality system baseline can ignore other systems findings ( same object name)?

         

        Thanks

        Srinivas

        • Hi Srinivas,

          at your remote ATC setup if you define a baseline in your quality system and execute remote ATC runs for your RFC connected  dev (or quality) systems then you can take over the findings from these central ATC runs into the baseline.  This baseline has no effect for the local ATC runs on the connected systems.

          Regards,

          Olga.

  • Hi Olga,

     

    From Central ATC system, i ran ATC checks for Z* & Y* packages in remote connected system, and added all errors to baseline as exemptions.

    Again i ran ATC checks for specific Z package from Central ATC to same remote system, still i found 1000 unresolved findings. Does that mean, previous ATC check is not successful?

    What could be issue? Any leads would be helpful.

    Thanks,

    Srinivas

    • Hi Srinivas,

      it shouldn’t happen. Have you checked the “Consider Baseline” option at scheduling the second ATC run?

      Bye,

      Olga.