Skip to content

Lesson 1 Practice — Course Eligibility Checker ​

Create:

text
ZCL_ABAP_L01_PRACTICE_###

Implement IF_OO_ADT_CLASSRUN.

Problem ​

A training provider accepts a registration when:

text
name is present
age >= 18
experience_years >= 0
accepted_terms = abap_true

If accepted, calculate:

text
completion_year = current_year + 1

Requirements ​

Create variables for:

text
name
age
experience_years
accepted_terms
current_year

Use:

text
string template output
arithmetic
IF / ELSEIF / ELSE
abap_bool
at least one FINAL(...) local value

Test at least four cases:

  1. valid applicant;
  2. missing name;
  3. under 18;
  4. terms not accepted.

Questions ​

  1. Why must the class be activated before F9 uses the latest code?
  2. When would an explicit DATA ... TYPE ... declaration be clearer than inline DATA(...)?
  3. What does IS INITIAL test?
  4. Why use abap_true/abap_false instead of custom Y/N values?
  5. What is the difference between Eclipse/ADT and the ABAP backend?

Checklist ​