Skip to content

Lesson 2 Practice — Number Analyzer ​

Create:

text
ZCL_ABAP_L02_PRACTICE_###

Requirements ​

Create an internal table containing at least 10 integers.

Write methods:

text
SUM
COUNT_EVEN
COUNT_GREATER_THAN
MINIMUM
MAXIMUM

COUNT_GREATER_THAN must import a threshold.

Your main method should:

  1. build the internal table;
  2. print each value with its index;
  3. call every method;
  4. print the results.

Additional task ​

Create a second internal table of circle radii and call a CIRCLE_AREA method for each radius.

Reasoning ​

  1. Why is this data not persistent?
  2. When is sy-tabix meaningful?
  3. What can happen if numbers[ 50 ] is evaluated when no such line exists?
  4. Why might a method be clearer than putting every calculation in main?
  5. When is VALUE preferable to repeated APPEND statements?

Checklist ​