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 given by Christopher Kaestner 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’.

/wp-content/uploads/2014/11/atc_check_568755.png

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).

/wp-content/uploads/2014/11/atc_variant_568756.png

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.

/wp-content/uploads/2014/11/atc_filter_568757.png

As soon as you correct a finding, it disappears from your worklist after recheck.

/wp-content/uploads/2014/11/atc_recheck_568758.png

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’.

/wp-content/uploads/2014/11/atc_exempted_568759.png

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.

/wp-content/uploads/2014/11/atc_exemption_568782.png

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.

/wp-content/uploads/2014/11/atc_grouping_568783.png

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’.

/wp-content/uploads/2014/11/atc_transports_568784.png

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.

/wp-content/uploads/2014/11/atc_qresults_568799.png

You can also select the active check run and press ‘Show Details’ button to display its details.

/wp-content/uploads/2014/11/atc_show_details_568800.png

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( ).

To report this post you need to login first.

18 Comments

You must be Logged on to comment or reply to a post.

    1. Olga Dolinskaja Post author

      Hi Florian,

      thank you for the nice words :-). Stay turned for more ABAP related new content on SCN and of course: try out the new ABAP Test Cockpit in Eclipse!

      Best,

      Olga.

      (0) 
  1. Justin Loranger

    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

    (0) 
  2. Mathias Maerker

    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.)

    (0) 
    1. Ekaterina Zavozina

      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

      (0) 
      1. Mathias Maerker

        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

        (0) 
        1. Volker Wegert

          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

          (0) 
          1. Mathias Maerker

            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

            (0) 
  3. Tanmay Srivastava

    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

    (0) 
    1. Peter Inotai

      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

      (0) 

Leave a Reply