You are on page 1of 19

DEV264

ABAP TEST COCKPIT

Overview
Estimated time: 15 minutes

Objective

In this exercise you are supposed to execute the ABAP Test Cockpit (ATC) online check on an example program and deal with
the emerging findings.

What you will learn

· How to trigger the ATC online check


· How to deal with different kinds of functional findings
· How to trigger the ATC recheck

Exercise description

Please perform the following steps:

· ATC Online Check


· Locate your example program ZDEV264_E1_XX (remember to replace XX with your group number)
· Execute the ATC online check on the program using the Code Inspector variant DEV264
· Handling Findings I: READ .. BINARY SEARCH
· Locate and inspect the findings related to a READ .. BINARY SEARCH / BREAK-POINT statement
· Fix the issues and perform a recheck
· Handling Findings II: DELETE ADJACENT DUPLICATES
· Locate and inspect the finding related to a DELETE ADJACENT DUPLICATES statement
· Fix the issue and perform a recheck
· Handling Findings III: Empty FOR ALL ENTRIES Tables
· Locate and inspect the finding related to an Empty FOR ALL ENTRIES Table
· Fix the issue and perform a recheck

ATC Online Check

Explanation Screenshot

1. Enter se80 in the Transaction


box and confirm your entry by
pressing the Enter key in order to
start up the ABAP Development
Workbench.

2. Click Open .

4
DEV264

Explanation Screenshot

3. Select the entry


Program
from the
drop-down menu.

4. Enter ZDEV264_E1_XX in the box


(replace XX with your group number)
and confirm your entry by pressing
the Enter key.

5. Double-click the program name


and inspect the
source code that opens up in the
editor on the right-hand side.

6. Right-click on the program name


with the mouse
to open a shortcut menu.

5
DEV264

Explanation Screenshot

7. Select ABAP Test Cockpit (ATC)


with...

from the menu.

8. Click to switch to the


options tab.

9. Enter DEV264 in the field Code


Inspector Check Variant.

10. Start the ATC check by clicking


Execute
Checks .

6
DEV264

Explanation Screenshot

Your result list should look similar to


this screenshot. If you are faced with
different findings, chances are that
you picked the wrong Code
Inspector check variant. For this
exercise you need to use the variant
DEV264.

7
DEV264

Handling Findings I: READ .. BINARY SEARCH

Explanation Screenshot

1. Select the READ .. BINARY


SEARCH finding.

2. Click to bring up the details


view. Alternatively you can also
double-click the line.

3. Click the Check Message hotspot


link to bring up the documentation.

8
DEV264

Explanation Screenshot

4. Use the vertical scroll bar to


scroll to the end of the
documentation.

5. The What you can do section at


the bottom provides hints on how to
fix the issue.

6. Click Close to dismiss the


popup.

9
DEV264

Explanation Screenshot

7. If required, use the vertical scroll


bar to scroll to the bottom.

8. Click Display Object to


navigate to the source code.

As this finding consists of two parts


(the SELECT and the READ
.. BINARY SEARCH) you are first
presented the call stack.
9. Double-click the first
line

to get to the SELECT statement.

10. Click Display <-> Change to


switch to editing mode.

10
DEV264

Explanation Screenshot

11. If you are prompted to create a


new task, just confirm by
clicking Continue .

12. Fix the issue by adding an


additional ORDER BY clause to the
SELECT statement.
13. While you're at it, you can as well
remove the BREAK-POINT
statement.

14. Click Activate .

11
DEV264

Explanation Screenshot

15. Click to go back to the call


stack.

16. Click to go back to the list of


findings.

17. Click to repeat the ATC


check.

12
DEV264

Explanation Screenshot

18. Notice that the READ .. BINARY


SEARCH finding is gone.

19. If required, use the vertical


scroll bar to scroll to the end of the
list.

20. The BREAK-POINT statement


was also recognized by the ATC and
is gone as well.

13
DEV264

Handling Findings II: DELETE ADJACENT DUPLICATES

Explanation Screenshot

1. Select the DELETE ADJACENT


DUPLICATES finding.

2. Click to bring up the details


view. As before, you can as well just
double-click the line.

3. If required, use the vertical scroll


bar to scroll to the bottom.

4. Click Display Object to


navigate to the source code.

14
DEV264

Explanation Screenshot

As in the previous exercise, this


finding consists of two parts (the
SELECT and the DELETE
ADJACENT DUPLICATES) and so
you are first presented the call stack.
5. Double-click the last line to get to
the DELETE ADJACENT
DUPLICATES statement.

6. Click Display <-> Change to


switch to editing mode.

7. Fix the issue by adding an ABAP


SORT statement.

15
DEV264

Explanation Screenshot

8. Click Activate .

9. Click to return to the call


stack.

10. Click to go back to the list of


findings.

16
DEV264

Explanation Screenshot

11. Click to repeat the ATC


check.

12. Notice that the finding is gone.

17
DEV264

Handling Findings III: Empty FOR ALL ENTRIES Tables

Explanation Screenshot

1. Select the FOR ALL ENTRIES


finding.

2. Click to bring up the detail


view. Alternatively you can also
double-click the line.

3. Click the Check Message hotspot


link to bring up the documentation.

18
DEV264

Explanation Screenshot

4. If required, use the vertical scroll


bar to scroll down to the section
Proposed Solution.

5. The Proposed Solution section


offers hints on how to fix the issue.

19
DEV264

Explanation Screenshot

6. Click Close to dismiss the


popup.

7. If required, use the vertical scroll


bar to scroll to the bottom.

8. Click Display Object to


navigate to the source code.

9. Click Display <-> Change to


switch to editing mode.

20
DEV264

Explanation Screenshot

10. Add an IF statement to ensure


that the FOR ALL ENTRIES table is
not empty.

11. Click Activate .

12. Click to return to the list of


findings.

13. Click to repeat the ATC


check.

21
DEV264

Explanation Screenshot

14. Congratulations, you have fixed


all of the findings and completed this
exercise.

Summary
This exercise should have provided you with a basic understanding of how to use the ABAP Test Cockpit to locate functional
errors in ABAP source code.

22

You might also like