ABAP Test Cockpit (ATC) for Developers in Eclipse
Good news for ABAP Development Tools developers in Eclipse: ABAP Test Cockpit (ATC) is available in Eclipse with ADT 2.31. For those of you, who are not familiar with ABAP Test Cockpit, it is a toolset, which allows you to significantly improve the code quality during development process. With ATC you can detect the quality issues with regard to performance, security, programming conventions by regular executing static and dynamic (ABAP Unit) checks (of course you can reuse your Code Inspector backend check infrastructure). A very good general overview about ATC is offered in the blog ABAP Test Cockpit – an Introduction to SAP’s new ABAP Quality Assurance Tool .
The ATC in Eclipse is tightly integrated with ABAP developer tools so that you can run ATC checks during development from the Project Explorer or editor and adjust the quality findings consequently by stepping to the relevant source code lines in the editor and correcting them one by one. You can also check with ATC your transport requests in the Transport Organizer before releasing them. And last but not least you can keep the eye on the central check results from your Q system and correct the reported quality findings.
The live demonstration (video) of the ABAP Test Cockpit tools in Eclipse is now on ABAP Channel in YouTube:
Let’s take a look at the brand new ATC tools in Eclipse in detail.
Check the quality of your source code
It’s quite simple. You can run ATC for a single object in the editor or select multiple objects or even packages using context menu
‘Run As-> ABAP Test Cockpit’.
The tool of choice to analyse the quality issues is the ATC Problems View. It displays the worklist of ATC findings for you as developer to work on. By default the findings are grouped by priority: errors, warnings, information. Clicking on a finding displays its detailed information.The check variant is displayed in the breadcrumb (if required, change the variant in the project properties under ABAP Development).
In the breadcrumb you can filter the findings in the ATC Problems View and in this way restrict the view to the findings you need to focus on for correction. You can concentrate your correction work for example on the findings, belonging to the last check run (‘Last Check Run’ entry), package, transport request, or recheck of result from the central Q system. Every time you run ATC, the breadcrumb gets a new filter entry if required (e.g. if a new package is checked) and the findings will be added to your worklist.
As soon as you correct a finding, it disappears from your worklist after recheck.
There might be also such situations where a correction of the finding is not possible or not appropriate (e.g. the hard-corded text message, which is not relevant for translation). In such situations the ABAP Test Cockpit offers the possibility to create exemptions for the affected source code parts so that the findings will be hidden from the results. But you can still display them by using the display option ‚Include Exempted Findings’.
Create the exemption by right-clicking on the finding. You need to enter your quality expert (use content assist Ctrl + Space), reason for exemption and justification. As soon as your quality expert approves it, the finding will be marked accordingly in ATC results and will not appear in your worklist.
You can also customize the view on the findings in ATC Problems View and group the findings by priority, objects or checks for your convenience or configure the columns.
Ideally you should run ATC and correct the findings in the ATC Problems View on a regular base during your development process.
Check your transports before release
It is recommended to check regular with ATC your transport requests before release to catch erroneous situations and avoid transporting the source code with quality problems into quality and production systems. This can be done in the Transport Organizer View in Eclipse. There you can choose your transport request and run ATC using context menu ‘Run As->ABAP Test Cockpit’.
After execution of ATC checks you will be redirected to the ATC Problems View, where you can focus on the findings, reported for this transport request and get rid of all of them one by one (btw. the new filter entry for the selected transport request will be added to the breadcrumb).
Access ATC results from the central Q system
After your quality expert runs mass (regression) quality checks with the ATC, the results of these checks will be published to the development systems as the current, active ATC result. You as developer can use this central result to eliminate quality problems. You can access the ATC results from the central Q system in the ATC Result Browser (menu ‘Window ->Show view->Other…->ATC Result Browser’). You can select the active ATC result on the left and display the findings of the result on the right.
You can also select the active check run and press ‘Show Details’ button to display its details.
You will get the same information as in the ATC Problems View. Of course you can customize the view by configuring the view columns or group the findings as in the ATC Problems View. Before you start to correct findings execute recheck to make sure they still are relevant.You can rerun ATC checks and consequently correct the remaining findings belonging to the check run result in the ATC Problems View (btw. the new filter entry for the result will be added to the breadcrumb) .
That’s it. Just try out the new ABAP Test Cockpit tools in Eclipse to increase the quality of your source code during development.
For quick and easy try copy & paste this ATC_EXAMPLE report into your system and run ATC for it.
REPORT ATC_EXAMPLE.
parameters p_selall
type abap_bool default ‘X’.
class lcl_atc_example definition.
public section.
methods run.
endclass.
class lcl_atc_example implementation.
method run.
data:
lt_spfli type spfli,
lv_flight type sflight.
” ATC ERROR: Incompatible parameter in the function call
“ lt_spfli(type SPFLI) with the function signature
” parameter (type SPFLI_TAB)
” PROPOSED CORRECTION: replace in the DATA section TYPE spfli with spfli_tab.
if ( p_selall = abap_true ).
call function ‘READ_SPFLI_INTO_TABLE’
exporting
id = ‘AA’
importing
itab = lt_spfli.
endif.
” ATC ERROR: Strings without text elements are not translated
” PROPOSED CORRECTION: Create text element using Quick Fix Ctrl + 1
message ‘Display flight information’ type ‘I’.
” ATC ERROR: Performance check SELECT accesses the non-buffered
“ table SFLIGHT with WHERE condition,
” which doesn’t contain any key fields of the table.
” PROPOSED CORRECTION: SELECT * FROM sflight INTO lv_flight
“ WHERE carrid = ‘AA’ AND seatsmax = 10.
select * from sflight into lv_flight where seatsmax = 10.
endselect.
endmethod.
endclass.
start-of-selection.
data example type ref to lcl_atc_example.
create object example.
example->run( ).
Hi Olga,
A very informative blog. Thanks.
Cheers,
Naveen
Hi Olga,
welcome back. Good to read something new from you 🙂
~Florian
Hi Florian,
thank you for the nice words :-). Stay tuned for more ABAP related new content on SCN and of course: try out the new ABAP Test Cockpit in Eclipse!
Best,
Olga.
Hi Olga,
I was not ware of ATC iintegration into Eclipse. We use ATC a lot and this integration makes live easy 🙂 .
Thanks,
Henk.
Hi Henk,
good to hear, that you already actively use ATC! We are open for any feedback on Eclipse integration. Try it out!
Best,
Olga.
Very helpfull, thank you!
Hello Olga.
Thank you for the blog.
Does this require 7.4 and SP8? I am able to run the ATC from my instance of Eclipse (Luna and ADT 2.31) however the results are only shown in the Problems tab. The ATC Problems tab is available but not populated or interactive. We are currently on 7.4 and SP5.
Regards,
Justin Loranger
Hi Justin,
yes, you need AS ABAP 7.4 SP8 backend.
Regards,
Olga.
Ah, ok, I had a feeling. Still good stuff, however.
Thank you.
Justin
Damn ... 😉
W also only have 7.40 SP5 ...
Thanks anyway, i suppose we will have it in summer.
Stefan
I have a problem. When i run the ATC checks they don't sho up in the ATC Problem view. Instead they show up in te Standard Problem view of Eclipse. And somehow the extended Syntaxchek is missing some warnings(e.g. not catched exceptions etc.)
Hello Mathias,
As Olga mentioned earlier you need AS ABAP 7.4 SP8 backend to be able to use new ATC features in Eclipse. I guess you are connected to an "old" backend system.
Regarding the missing Extended Syntax Check (SLIN) warnings: not all the SLIN warnings can be reported by ATC or Code Inspector, only a subset, which is defined by SLIN STANDARD variant. So all findings reported in the transaction SLIN using the STANDARD pushbutton (shift+F8) for your object will be reported within ATC and Code Inspector.
Best regards,
Katja
Hello Katja,
thanks a lot for that information, i should have read the article a little bit closer 😉 i will check SLIN to see if i can adapt it to my need. Anyway i am "missusing" SLIN a bit. for example i use not existing pragmas like ##FIXIT or ##TODO to have kind of code pointers where something is to do. I know this stuff from the Java world...
Regards
Mathias
Hello, Matthias,
for TODO markers, I prefer to use checkpoint groups. With an ABAP editor shortcut, it's easy enought to insert BREAK-POINT ID /FOO/BAR_TODO into the code, and since there's a where-used function for checkpoint groups, they are easy to find.
Best regards
Volker
Hello Volker,
nice idea as well, but you have to use the where-used function then for every checkpoint group i guess? The nice thing about the pragmas was they where shown in eclipse for the whole package, without doing anything but i will look into it as well.
Best regards
Mathias
Nice!
🙂
Hi Olga,
I need your help.
We are enabling ABAP test cockpit in our company. We want to perform ATC check during TR release and want to block TR's if ATC errors have been identified. If we enable TR block functionality during ATC run then all workbench TR's will be blocked when ATC get any findings.
We have many existing custom programs with the large number of errors present & we often get change request for these programs to meet business requirement. If we enable TR blockage during ATC run then all existing errors will also get caught in ATC run and system will not allow to release that TR without correcting or exempting all the errors. We can't do this, we want to enable TR block only for the new developments which will be done going forward and not for the change request coming for existing programs. Can you please suggest some way of handling this situation ?
Regards,
Tanmay
Hi,
You can build your own check as an implementation for Badi CTS_REQUEST_CHECK eg for method CHECK_BEFORE_RELEASE.
You can read the check result from table SATC_AC_RESULTH. In TITLE you have the request number.
Best regards
Peter
Hello Olga Dolinskaja , Hello Thomas Fiedler ,
it's me again 😉
I'm close to the finish line (central ATC, Baseline, Transport checks implemented). Now testing the exemptions. With the exemption mails I have some problems:
Regarding the language: in class CL_SATC_CI_EXEMPTION_JOBS, local class scheduling_Service, method schedule the language ist always set to "E":
Wishes for one the next releases:
Keep up the good work!
Cheers, Uwe
Great video, thanks Olga.
Taking this one step further, would you have any info on running sapgui scripting against a program/t-code from inside Eclipse?
Cheers, Derek
Hi Derek,
I can just point you to the blog SAPGUI Scripting with ABAP in Eclipse.
Best Regards,
Olga.
Hi,
what can I do, when i have not these options under RUNAS?
Hi Marcel,
please verify your ADT version. ABAP Test Cockpit (ATC) is available in Eclipse with ADT 2.31.
Best regards,
Olga.
Hi Olga,
i have the version 2.83.
Best regards
Marcel
Hi Marcel,
your ABAP backend must be >=AS ABAP 7.4 SP8 for using ATC in Eclipse.
If it is so, try to reinstall ADT and try again.
Regards,
Olga.
Hello,
I faced the same problem and I managed to fix it.
To do it, you have to modify your System Role in ATC Administration.
T-Code ATC
ATC Administration → Setup → System Role
Choose “Local ATC Checks Only” and Save.
Then restart Eclipse.
I hope this will help.
Hi Olga,
We have enabled ATC checks in our organisation and activated the baseline functionality as well to make sure only the new code changes are scanned going forward.
But we are facing a challenge, if we make any minor change in already baselined code, ATC starts scanning the old baselined code as well.
Anyway we can avoid it?
Thanks,
Manish
Hi Manish,
no, the baseline is effective as long as the related code sections remain unchanged. This is the concept of the baseline: exclude from ATC checks old legacy code, which will not be changed. If you change the code, the baseline becomes invalid.
Regards,
Olga.
Hi Olga,
I want to enhance ATC to add some custom checks, do you have some SAP documentation around the same?
I could find certain standard classes which I can derive and add the custom logic, but not very sure if there is another way for achieving the same.
Hi Manish,
yes, we have a guide about how to write a custom ATC check. Please see the blog https://blogs.sap.com/2018/09/06/remote-code-analysis-in-atc-how-to-write-an-atc-check/
Regards,
Olga.
Thanks Olga.
Hi Olga,
Nice blog. For running the ATC cehck on eclipse, is the default variant recommended always?
What are the various statements maintained under different variants?
Regards,
Udita
Hi Udita,
you can run ATC with any check variant. Just use contextmenu „Run ABAP Test Cockpit with...“ and enter your check variant name into textfield in the popup. You can maintain your own check variant in the transaction SCI.
Best Regards,
Olga.
Hi Olga,
We are using ATC successfully in our company. But we want to add few more checks to the existing variant. Before we actually add the new checks to existing variant, I would like to try them out in another variant, which will include the checks from existing variant plus the new checks.
I wanted to know if we switch to the new variant, will our baseline get invalid?
Hi Manish,
you can use any check variant you want, the baseline will not be affected, since baseline relates to the findings and not to the check variants.
Best Regards,
Olga.
Thanks Olga.
Hi Olga,
We have an old ECC system, and it is on SAP_BASIS release 7.0 (SAPKB70012), I want to configure it for the central ATC check, but I am not able to find transaction ATC in it.
What additional component is required for configuring ATC in remote system?
Hi Manish,
ATC is available with SAP_BASIS 7.02 SP12 at the earliest. You need to upgrade the SAP_BASIS in order to get ATC in this system. Nevertheless you can check this system with remote ATC check. See the blog https://blogs.sap.com/2016/12/13/remote-code-analysis-in-atc-technical-setup-step-by-step/
Regards,
Olga.
Hi Olga,
We upgraded our ATC system from 7.52 SP0 to 7.52 SP7, and getting priority 1 and 2 errors from legacy code, which we didn't encounter earlier.
Specifically the below check is being reported by multiple developers:
Check "Search problematic SELECT * statements"
Check Message Incomplete evaluation. ...% of fields used
I did check the variant in the old and new system, nothing has changed and this check was enabled already.
It doesn't seem that baseline got disturbed, else we would started receiving a lot of other errors. Could you please guide?
Regards,
Manish
Hi Manish,
please open a ticket to SAP to get this investigated.
Regards,
Olga.
Hi Olga,
We upgraded our ATC system from 7.52 SP0 to 7.52 SP7, but now we are not able to connect to our existing S/4 HANA 1909 system. This was working fine before the upgrade.
We are getting the error "The current checked system's SAP_BASIS release is not supported" while running baseline.
Could you please advice on it or we need to open the support incident.
Regards,
Manish
Hi Manish,
please move your question to the Q&A section of the community since it does not relate to this blog. Please consider also that the central ATC check system can only analyze checked systems at the same or lower release levels, e.g. central ATC check system on 7.52 is not able to analyze S/4HANA 1909 system.
Best regards,
Olga.
Hi Olga
I wrote few custom checks and create a Z variant in ATC in my S/4 system but when i try to scan my program in Eclipse using same z variant. Variant does not appear in eclipse. Could you please help.
Thanks
Amit Gupta
Hi Amit,
please move your question to the Q&A section of the community since it does not relate to this blog. Please provide also details (screenshots) what happens exactly.
Best regards,
Olga.
Hi Olga,
Thank you for the detailed blog on this topic.
Do you know if there's another blog or documentation which clarifies the system requirements and prerequisites for running ATC on ADT, according to different SAP releases?
It gets a bit confusing for me... For instance, we have a client with SAP backend on S/4 HANA 1909 FPS 01. And when I try to access the ATC results in latest ADT 3.20 under latest eclipse 2021-06, I can't find the option 'Show in ATC Problems View' in the context menu from the ATC Result Browser...
I can only see the results in ATC Result Browser, which obviously doesn't have the features like Quick fix, etc.
Any idea what might be missing here? Any SAP notes in the backend, or any config? I can't find any documentation online about the same...
Hi Mithun,
you can run ATC in ADT over your code starting with the ADT 2.31. Just use the Project Explorer context menu "Run As -> ABAP Test Cockpit". The Quick Fixes can be then applied to your ATC run result starting with the SAP S/4HANA 1809 and ADT 2.96. See the blog https://blogs.sap.com/2018/10/02/semi-automatic-custom-code-adaptation-after-sap-s4hana-system-conversion/. The example you are referring to is just a feature of ATC Result Browser, which is available in the higher release.
Kind Regards,
Olga.
Thanks for replying, Olga.
I found a Note 2907328, to enable the "Show in problems View" menu item. Once the problems view got enabled, we can see the quick fixes as well.